This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH v2 13/16] remove gdb_stat.h
- From: Tom Tromey <tromey at redhat dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tromey at redhat dot com>
- Date: Wed, 6 Nov 2013 10:09:57 -0700
- Subject: [PATCH v2 13/16] remove gdb_stat.h
- Authentication-results: sourceware.org; auth=none
- References: <1383757800-6332-1-git-send-email-tromey at redhat dot com>
This patch is purely mechanical. It removes gdb_stat.h and changes
the code to use sys/stat.h.
2013-11-06 Tom Tromey <tromey@redhat.com>
* common/gdb_stat.h: Remove.
* ada-lang.c: Use sys/stat.h, not gdb_stat.h.
* common/filestuff.c: Use sys/stat.h, not gdb_stat.h.
* common/linux-osdata.c: Use sys/stat.h, not gdb_stat.h.
* corefile.c: Use sys/stat.h, not gdb_stat.h.
* ctf.c: Use sys/stat.h, not gdb_stat.h.
* darwin-nat.c: Use sys/stat.h, not gdb_stat.h.
* dbxread.c: Use sys/stat.h, not gdb_stat.h.
* dwarf2read.c: Use sys/stat.h, not gdb_stat.h.
* exec.c: Use sys/stat.h, not gdb_stat.h.
* gdbserver/linux-low.c: Use sys/stat.h, not gdb_stat.h.
* gdbserver/remote-utils.c: Use sys/stat.h, not gdb_stat.h.
* inf-child.c: Use sys/stat.h, not gdb_stat.h.
* jit.c: Use sys/stat.h, not gdb_stat.h.
* linux-nat.c: Use sys/stat.h, not gdb_stat.h.
* m68klinux-nat.c: Use sys/stat.h, not gdb_stat.h.
* main.c: Use sys/stat.h, not gdb_stat.h.
* mdebugread.c: Use sys/stat.h, not gdb_stat.h.
* mi/mi-cmd-env.c: Use sys/stat.h, not gdb_stat.h.
* nto-tdep.c: Use sys/stat.h, not gdb_stat.h.
* objfiles.c: Use sys/stat.h, not gdb_stat.h.
* procfs.c: Use sys/stat.h, not gdb_stat.h.
* remote-fileio.c: Use sys/stat.h, not gdb_stat.h.
* remote-mips.c: Use sys/stat.h, not gdb_stat.h.
* remote.c: Use sys/stat.h, not gdb_stat.h.
* rs6000-nat.c: Use sys/stat.h, not gdb_stat.h.
* sol-thread.c: Use sys/stat.h, not gdb_stat.h.
* solib-spu.c: Use sys/stat.h, not gdb_stat.h.
* source.c: Use sys/stat.h, not gdb_stat.h.
* symfile.c: Use sys/stat.h, not gdb_stat.h.
* symmisc.c: Use sys/stat.h, not gdb_stat.h.
* symtab.c: Use sys/stat.h, not gdb_stat.h.
* top.c: Use sys/stat.h, not gdb_stat.h.
* xcoffread.c: Use sys/stat.h, not gdb_stat.h.
---
gdb/ChangeLog | 37 +++++++++++++++++++++++++++
gdb/ada-lang.c | 2 +-
gdb/common/filestuff.c | 2 +-
gdb/common/gdb_stat.h | 59 --------------------------------------------
gdb/common/linux-osdata.c | 2 +-
gdb/corefile.c | 2 +-
gdb/ctf.c | 2 +-
gdb/darwin-nat.c | 2 +-
gdb/dbxread.c | 2 +-
gdb/dwarf2read.c | 2 +-
gdb/exec.c | 2 +-
gdb/gdbserver/linux-low.c | 2 +-
gdb/gdbserver/remote-utils.c | 2 +-
gdb/inf-child.c | 2 +-
gdb/jit.c | 2 +-
gdb/linux-nat.c | 2 +-
gdb/m68klinux-nat.c | 2 +-
gdb/main.c | 2 +-
gdb/mdebugread.c | 2 +-
gdb/mi/mi-cmd-env.c | 2 +-
gdb/nto-tdep.c | 2 +-
gdb/objfiles.c | 2 +-
gdb/procfs.c | 2 +-
gdb/remote-fileio.c | 2 +-
gdb/remote-mips.c | 2 +-
gdb/remote.c | 2 +-
gdb/rs6000-nat.c | 2 +-
gdb/sol-thread.c | 2 +-
gdb/solib-spu.c | 2 +-
gdb/source.c | 2 +-
gdb/symfile.c | 2 +-
gdb/symmisc.c | 2 +-
gdb/symtab.c | 2 +-
gdb/top.c | 2 +-
gdb/xcoffread.c | 2 +-
35 files changed, 70 insertions(+), 92 deletions(-)
delete mode 100644 gdb/common/gdb_stat.h
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index d5924b1..c9a02e8 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -43,7 +43,7 @@
#include "gdb_obstack.h"
#include "ada-lang.h"
#include "completer.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
#ifdef UI_OUT
#include "ui-out.h"
#endif
diff --git a/gdb/common/filestuff.c b/gdb/common/filestuff.c
index bbb60a7..2792d59 100644
--- a/gdb/common/filestuff.c
+++ b/gdb/common/filestuff.c
@@ -29,7 +29,7 @@
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
#ifdef USE_WIN32API
#include <winsock2.h>
diff --git a/gdb/common/gdb_stat.h b/gdb/common/gdb_stat.h
deleted file mode 100644
index 3e3c981..0000000
--- a/gdb/common/gdb_stat.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* Portable <sys/stat.h>
- Copyright (C) 1995-2013 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#if !defined(GDB_STAT_H)
-#define GDB_STAT_H
-
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#if !defined(S_ISBLK) && defined(S_IFBLK)
-#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
-#endif
-#if !defined(S_ISCHR) && defined(S_IFCHR)
-#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
-#endif
-#if !defined(S_ISDIR) && defined(S_IFDIR)
-#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
-#endif
-#if !defined(S_ISREG) && defined(S_IFREG)
-#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
-#endif
-#if !defined(S_ISFIFO) && defined(S_IFIFO)
-#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
-#endif
-#if !defined(S_ISLNK) && defined(S_IFLNK)
-#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
-#endif
-#if !defined(S_ISSOCK) && defined(S_IFSOCK)
-#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
-#endif
-#if !defined(S_ISMPB) && defined(S_IFMPB) /* V7 */
-#define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB)
-#define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC)
-#endif
-#if !defined(S_ISNWK) && defined(S_IFNWK) /* HP/UX */
-#define S_ISNWK(m) (((m) & S_IFMT) == S_IFNWK)
-#endif
-
-/* Microsoft C's stat.h doesn't define all the POSIX file modes. */
-#ifndef S_IROTH
-#define S_IROTH S_IREAD
-#endif
-
-#endif /* !defined(GDB_STAT_H) */
diff --git a/gdb/common/linux-osdata.c b/gdb/common/linux-osdata.c
index 0ff10c6..90da899 100644
--- a/gdb/common/linux-osdata.c
+++ b/gdb/common/linux-osdata.c
@@ -43,7 +43,7 @@
#include "buffer.h"
#include "gdb_assert.h"
#include <dirent.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include "filestuff.h"
#define NAMELEN(dirent) strlen ((dirent)->d_name)
diff --git a/gdb/corefile.c b/gdb/corefile.c
index e82f978..878ab3b 100644
--- a/gdb/corefile.c
+++ b/gdb/corefile.c
@@ -30,7 +30,7 @@
#include "target.h"
#include "gdbcore.h"
#include "dis-asm.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include "completer.h"
#include "exceptions.h"
#include "observer.h"
diff --git a/gdb/ctf.c b/gdb/ctf.c
index 23ee36d..ba8190e 100644
--- a/gdb/ctf.c
+++ b/gdb/ctf.c
@@ -23,7 +23,7 @@
#include "ctf.h"
#include "tracepoint.h"
#include "regcache.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include "exec.h"
#include "completer.h"
diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
index 6995c25..ae95f79 100644
--- a/gdb/darwin-nat.c
+++ b/gdb/darwin-nat.c
@@ -32,7 +32,7 @@
#include "regcache.h"
#include "event-top.h"
#include "inf-loop.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include "exceptions.h"
#include "inf-child.h"
#include "value.h"
diff --git a/gdb/dbxread.c b/gdb/dbxread.c
index 67deeec..a810f42 100644
--- a/gdb/dbxread.c
+++ b/gdb/dbxread.c
@@ -39,7 +39,7 @@
#endif
#include "gdb_obstack.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include "symtab.h"
#include "breakpoint.h"
#include "target.h"
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 0579ce0..32a7a16 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -56,7 +56,7 @@
#include "jv-lang.h"
#include "psympriv.h"
#include "exceptions.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include "completer.h"
#include "vec.h"
#include "c-lang.h"
diff --git a/gdb/exec.c b/gdb/exec.c
index afd3224..38d2edb 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -42,7 +42,7 @@
#include "gdbcore.h"
#include <ctype.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
void (*deprecated_file_changed_hook) (char *);
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 799fcc9..6355fa8 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -41,7 +41,7 @@
#include <pwd.h>
#include <sys/types.h>
#include <dirent.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include <sys/vfs.h>
#include <sys/uio.h>
#include "filestuff.h"
diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c
index 8e8a4d6..a48ca35 100644
--- a/gdb/gdbserver/remote-utils.c
+++ b/gdb/gdbserver/remote-utils.c
@@ -57,7 +57,7 @@
#if HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
-#include "gdb_stat.h"
+#include <sys/stat.h>
#if HAVE_ERRNO_H
#include <errno.h>
#endif
diff --git a/gdb/inf-child.c b/gdb/inf-child.c
index 36fa81d..3db09c9 100644
--- a/gdb/inf-child.c
+++ b/gdb/inf-child.c
@@ -25,7 +25,7 @@
#include "target.h"
#include "inferior.h"
#include <string.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include "inf-child.h"
#include "gdb/fileio.h"
#include "agent.h"
diff --git a/gdb/jit.c b/gdb/jit.c
index ba0be5e..071afc0 100644
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -37,7 +37,7 @@
#include "symtab.h"
#include "target.h"
#include "gdb-dlfcn.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include "exceptions.h"
#include "gdb_bfd.h"
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 4fec30e..229b5a2 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -47,7 +47,7 @@
#include "gdbcore.h" /* for get_exec_file */
#include <ctype.h> /* for isdigit */
#include "gdbthread.h" /* for struct thread_info etc. */
-#include "gdb_stat.h" /* for struct stat */
+#include <sys/stat.h> /* for struct stat */
#include <fcntl.h> /* for O_RDONLY */
#include "inf-loop.h"
#include "event-loop.h"
diff --git a/gdb/m68klinux-nat.c b/gdb/m68klinux-nat.c
index 59511e4..f43d475 100644
--- a/gdb/m68klinux-nat.c
+++ b/gdb/m68klinux-nat.c
@@ -42,7 +42,7 @@
#endif
#include <sys/file.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include "floatformat.h"
diff --git a/gdb/main.c b/gdb/main.c
index d5c9e39..08f46f0 100644
--- a/gdb/main.c
+++ b/gdb/main.c
@@ -28,7 +28,7 @@
#include "getopt.h"
#include <sys/types.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include <ctype.h>
#include <string.h>
diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c
index 52c9331..e165c0a 100644
--- a/gdb/mdebugread.c
+++ b/gdb/mdebugread.c
@@ -55,7 +55,7 @@
#include "block.h"
#include "dictionary.h"
#include "mdebugread.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include <string.h>
#include "psympriv.h"
#include "source.h"
diff --git a/gdb/mi/mi-cmd-env.c b/gdb/mi/mi-cmd-env.c
index f1589e5..ca196f6 100644
--- a/gdb/mi/mi-cmd-env.c
+++ b/gdb/mi/mi-cmd-env.c
@@ -32,7 +32,7 @@
#include "top.h"
#include <string.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
static void env_mod_path (char *dirname, char **which_path);
diff --git a/gdb/nto-tdep.c b/gdb/nto-tdep.c
index 91f3928..674d572 100644
--- a/gdb/nto-tdep.c
+++ b/gdb/nto-tdep.c
@@ -20,7 +20,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include <string.h>
#include "nto-tdep.h"
#include "top.h"
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index f669e30..ba930fa 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -35,7 +35,7 @@
#include "gdb_assert.h"
#include <sys/types.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include <fcntl.h>
#include "gdb_obstack.h"
#include <string.h>
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 5f8c2f5..fff66a0 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -94,7 +94,7 @@
#include <fcntl.h> /* for O_RDONLY */
#include <unistd.h> /* for "X_OK" */
-#include "gdb_stat.h" /* for struct stat */
+#include <sys/stat.h> /* for struct stat */
/* Note: procfs-utils.h must be included after the above system header
files, because it redefines various system calls using macros.
diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c
index bf79068..c6e7ece 100644
--- a/gdb/remote-fileio.c
+++ b/gdb/remote-fileio.c
@@ -25,7 +25,7 @@
#include "remote.h"
#include "gdb/fileio.h"
#include "gdb_wait.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include "exceptions.h"
#include "remote-fileio.h"
#include "event-loop.h"
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c
index fef4fa8..ab3002f 100644
--- a/gdb/remote-mips.c
+++ b/gdb/remote-mips.c
@@ -30,7 +30,7 @@
#include "target.h"
#include "exceptions.h"
#include <string.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include "gdb_usleep.h"
#include "regcache.h"
#include <ctype.h>
diff --git a/gdb/remote.c b/gdb/remote.c
index 24c40e6..b245713 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -60,7 +60,7 @@
#include "remote-fileio.h"
#include "gdb/fileio.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include "xml-support.h"
#include "memory-map.h"
diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c
index fc9889c..d0ec0c7 100644
--- a/gdb/rs6000-nat.c
+++ b/gdb/rs6000-nat.c
@@ -50,7 +50,7 @@
#include <a.out.h>
#include <sys/file.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include "gdb_bfd.h"
#include <sys/core.h>
#define __LDINFO_PTRACE32__ /* for __ld_info32 */
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index 2266ebd..bffe1c1 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -56,7 +56,7 @@
#include "target.h"
#include "inferior.h"
#include <fcntl.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include <dlfcn.h>
#include "gdbcmd.h"
#include "gdbcore.h"
diff --git a/gdb/solib-spu.c b/gdb/solib-spu.c
index 590baba..c12324c 100644
--- a/gdb/solib-spu.c
+++ b/gdb/solib-spu.c
@@ -23,7 +23,7 @@
#include "gdbcore.h"
#include <string.h>
#include "gdb_assert.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include "arch-utils.h"
#include "bfd.h"
#include "symtab.h"
diff --git a/gdb/source.c b/gdb/source.c
index f89f534..0959585 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -31,7 +31,7 @@
#include <sys/types.h>
#include <string.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include <fcntl.h>
#include "gdbcore.h"
#include "gdb_regex.h"
diff --git a/gdb/symfile.c b/gdb/symfile.c
index e97d327..93d9d15 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -62,7 +62,7 @@
#include <sys/types.h>
#include <fcntl.h>
#include <string.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include <ctype.h>
#include <time.h>
#include <sys/time.h>
diff --git a/gdb/symmisc.c b/gdb/symmisc.c
index f4c3fc5..ec21c6c 100644
--- a/gdb/symmisc.c
+++ b/gdb/symmisc.c
@@ -32,7 +32,7 @@
#include "bcache.h"
#include "block.h"
#include "gdb_regex.h"
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include "dictionary.h"
#include "typeprint.h"
#include "gdbcmd.h"
diff --git a/gdb/symtab.c b/gdb/symtab.c
index babb16d..373ecea 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -51,7 +51,7 @@
#include <sys/types.h>
#include <fcntl.h>
#include <string.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include <ctype.h>
#include "cp-abi.h"
#include "cp-support.h"
diff --git a/gdb/top.c b/gdb/top.c
index e7ef418..3dfbce0 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -61,7 +61,7 @@
#include "event-top.h"
#include <string.h>
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include <ctype.h>
#include "ui-out.h"
#include "cli-out.h"
diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index c741fb4..2fba510 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -29,7 +29,7 @@
#ifdef HAVE_SYS_FILE_H
#include <sys/file.h>
#endif
-#include "gdb_stat.h"
+#include <sys/stat.h>
#include "coff/internal.h"
#include "libcoff.h" /* FIXME, internal data from BFD */
--
1.8.1.4