[PATCH v3 13/13] remove gdb_stat.h

Tom Tromey
2013-11-18T21:28:13Z

This patch is purely mechanical. It removes gdb_stat.h and changes
the code to use sys/stat.h.

2013-11-18 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 28daa24..417232c 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 a9157db..f0f938d 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 5e8f94e..1c7dfc5 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 3daa9fa..fde79e5 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 e9613ac..d2091ca 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 99a029e..bbeea12 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 7a2aeb8..ef9bb3d 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 14c494f..e4e5083 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 bbd9061..186c058 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 ec1245b..b480b58 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 0c8713a..59d0583 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 6bb0bbc..8fac0be 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 8b389c5..72a286b 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