From: Tom Tromey <tromey@redhat.com>
To: gdb-patches@sourceware.org
Subject: [3/10] RFC: remove gdb_dirent.h
Date: Thu, 15 Nov 2012 19:22:00 -0000 [thread overview]
Message-ID: <87r4nuy8lw.fsf@fleche.redhat.com> (raw)
In-Reply-To: <87obiyzns7.fsf@fleche.redhat.com> (Tom Tromey's message of "Thu, 15 Nov 2012 12:09:12 -0700")
This patch removes gdb_dirent.h in favor of the corresponding gnulib
module.
Tom
* gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add dirent.
* common/gdb_dirent.h: Remove.
* common/linux-osdata.c: Use <dirent.h>.
(NAMELEN): Define.
* config.in: Rebuild.
* configure: Rebuild.
* configure.ac: Don't call AC_HEADER_DIRENT.
* gnulib/aclocal.m4: Update.
* gnulib/configure: Update.
* gnulib/import/Makefile.am: Update.
* gnulib/import/Makefile.in: Update.
* gnulib/import/dirent.in.h: Update.
* gnulib/import/m4/dirent_h.m4: Update.
* gnulib/import/m4/gnulib-cache.m4: Update.
* gnulib/import/m4/gnulib-comp.m4: Update.
* gnulib/import/m4/unistd_h.m4: Update.
* linux-fork.c: Update.
* linux-nat.c: Update.
* nto-procfs.c: Update.
* procfs.c: Update.
* Makefile.in (linux-osdata.o): Don't reference gdb_dirent.h.
* config.in: Rebuild.
* configure: Rebuild.
* configure.ac: Don't call AC_HEADER_DIRENT.
---
gdb/common/gdb_dirent.h | 40 ---
gdb/common/linux-osdata.c | 4 +-
gdb/config.in | 15 -
gdb/configure | 159 ------------
gdb/configure.ac | 1 -
gdb/gdbserver/Makefile.in | 2 +-
gdb/gdbserver/config.in | 15 -
gdb/gdbserver/configure | 159 ------------
gdb/gdbserver/configure.ac | 1 -
gdb/gnulib/aclocal.m4 | 2 +
gdb/gnulib/configure | 465 ++++++++++++++++++++++++++++++++--
gdb/gnulib/import/Makefile.am | 50 ++++-
gdb/gnulib/import/Makefile.in | 215 +++++++++++++++-
gdb/gnulib/import/dirent.in.h | 258 +++++++++++++++++++
gdb/gnulib/import/m4/dirent_h.m4 | 64 +++++
gdb/gnulib/import/m4/gnulib-cache.m4 | 3 +-
gdb/gnulib/import/m4/gnulib-comp.m4 | 5 +
gdb/gnulib/import/m4/unistd_h.m4 | 187 ++++++++++++++
gdb/gnulib/update-gnulib.sh | 2 +-
gdb/linux-fork.c | 2 +-
gdb/linux-nat.c | 2 +-
gdb/nto-procfs.c | 2 +-
gdb/procfs.c | 2 +-
23 files changed, 1223 insertions(+), 432 deletions(-)
delete mode 100644 gdb/common/gdb_dirent.h
create mode 100644 gdb/gnulib/import/dirent.in.h
create mode 100644 gdb/gnulib/import/m4/dirent_h.m4
create mode 100644 gdb/gnulib/import/m4/unistd_h.m4
diff --git a/gdb/common/gdb_dirent.h b/gdb/common/gdb_dirent.h
deleted file mode 100644
index 183dfe4..0000000
--- a/gdb/common/gdb_dirent.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Portable <dirent.h>.
- Copyright (C) 2000, 2002, 2007-2012 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/>. */
-
-#ifndef GDB_DIRENT_H
-#define GDB_DIRENT_H 1
-
-/* See description of `AC_HEADER_DIRENT' in the Autoconf manual. */
-#ifdef HAVE_DIRENT_H
-# include <dirent.h> /* ARI: dirent.h */
-# define NAMELEN(dirent) strlen ((dirent)->d_name) /* ARI: strlen d_name */
-#else
-# define dirent direct
-# define NAMELEN(dirent) (dirent)->d_namelen /* ARI: d_namelen */
-# ifdef HAVE_SYS_NDIR_H
-# include <sys/ndir.h>
-# endif
-# ifdef HAVE_SYS_DIR_H
-# include <sys/dir.h>
-# endif
-# ifdef HAVE_NDIR_H
-# include <ndir.h>
-# endif
-#endif
-
-#endif /* not GDB_DIRENT_H */
diff --git a/gdb/common/linux-osdata.c b/gdb/common/linux-osdata.c
index afe3e75..0be6ba9 100644
--- a/gdb/common/linux-osdata.c
+++ b/gdb/common/linux-osdata.c
@@ -41,8 +41,10 @@
#include "xml-utils.h"
#include "buffer.h"
#include "gdb_assert.h"
-#include "gdb_dirent.h"
#include "gdb_stat.h"
+#include <dirent.h>
+
+#define NAMELEN(dirent) strlen ((dirent)->d_name)
/* Define PID_T to be a fixed size that is at least as large as pid_t,
so that reading pid values embedded in /proc works
diff --git a/gdb/configure.ac b/gdb/configure.ac
index ac0761e..28291ff 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1071,7 +1071,6 @@ fi
# Checks for header files. #
# ------------------------- #
-AC_HEADER_DIRENT
AC_HEADER_STDC
# elf_hp.h is for HP/UX 64-bit shared library support.
AC_CHECK_HEADERS([nlist.h machine/reg.h poll.h sys/poll.h proc_service.h \
diff --git a/gdb/gdbserver/Makefile.in b/gdb/gdbserver/Makefile.in
index fc4fd1d..a44c64e 100644
--- a/gdb/gdbserver/Makefile.in
+++ b/gdb/gdbserver/Makefile.in
@@ -517,7 +517,7 @@ gdb_vecs.o: ../common/gdb_vecs.c $(vec_h) $(gdb_vecs_h) $(host_defs_h)
xml-utils.o: ../common/xml-utils.c $(server_h)
$(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
-linux-osdata.o: ../common/linux-osdata.c $(server_h) $(linux_osdata_h) ../common/gdb_dirent.h
+linux-osdata.o: ../common/linux-osdata.c $(server_h) $(linux_osdata_h)
$(CC) -c $(CPPFLAGS) $(INTERNAL_CFLAGS) $<
ptid.o: ../common/ptid.c $(ptid_h)
diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac
index 2d8a703..9b364ff 100644
--- a/gdb/gdbserver/configure.ac
+++ b/gdb/gdbserver/configure.ac
@@ -36,7 +36,6 @@ AC_PROG_RANLIB
AC_ARG_PROGRAM
AC_HEADER_STDC
-AC_HEADER_DIRENT
AC_FUNC_ALLOCA
diff --git a/gdb/gnulib/update-gnulib.sh b/gdb/gnulib/update-gnulib.sh
index de82463..c9c78d5 100644
--- a/gdb/gnulib/update-gnulib.sh
+++ b/gdb/gnulib/update-gnulib.sh
@@ -29,7 +29,7 @@
# regenerate the various scripts and Makefiles are on the PATH.
# The list of gnulib modules we are importing in GDB.
-IMPORTED_GNULIB_MODULES="fnmatch-gnu inttypes memmem update-copyright string strerror strstr"
+IMPORTED_GNULIB_MODULES="fnmatch-gnu inttypes memmem update-copyright string strerror strstr dirent"
# The gnulib commit ID to use for the update.
GNULIB_COMMIT_SHA1="0dc43482065b697a7e64ac7cc7fba7c848924997"
diff --git a/gdb/linux-fork.c b/gdb/linux-fork.c
index b36bc2c..d46fe84 100644
--- a/gdb/linux-fork.c
+++ b/gdb/linux-fork.c
@@ -33,7 +33,7 @@
#include <sys/ptrace.h>
#include "gdb_wait.h"
#include <sys/param.h>
-#include "gdb_dirent.h"
+#include <dirent.h>
#include <ctype.h>
struct fork_info *fork_list;
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index e39347d..6b868f8 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -53,7 +53,7 @@
#include "event-top.h"
#include <pwd.h>
#include <sys/types.h>
-#include "gdb_dirent.h"
+#include <dirent.h>
#include "xml-support.h"
#include "terminal.h"
#include <sys/vfs.h>
diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c
index 5713fac..1c1890e 100644
--- a/gdb/nto-procfs.c
+++ b/gdb/nto-procfs.c
@@ -28,7 +28,7 @@
#include <sys/procfs.h>
#include <sys/neutrino.h>
#include <sys/syspage.h>
-#include "gdb_dirent.h"
+#include <dirent.h>
#include <sys/netmgr.h>
#include "exceptions.h"
diff --git a/gdb/procfs.c b/gdb/procfs.c
index 7249bec..3875858 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -90,7 +90,7 @@
#ifdef NEW_PROC_API
#include <sys/types.h>
-#include "gdb_dirent.h" /* opendir/readdir, for listing the LWP's */
+#include <dirent.h> /* opendir/readdir, for listing the LWP's */
#endif
#include <fcntl.h> /* for O_RDONLY */
--
1.7.7.6
next prev parent reply other threads:[~2012-11-15 19:22 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-15 19:09 [0/10] RFC: use gnulib more heavily + more configure fixes Tom Tromey
2012-11-15 19:11 ` Tom Tromey
2012-11-15 19:14 ` [1/10] RFC: update gnulib Tom Tromey
2012-11-15 19:19 ` Joel Brobecker
2012-11-15 19:15 ` [0/10] RFC: use gnulib more heavily + more configure fixes Eli Zaretskii
2012-11-15 19:22 ` Tom Tromey [this message]
2012-11-16 2:46 ` [3/10] RFC: remove gdb_dirent.h Joel Brobecker
2012-11-27 20:11 ` Tom Tromey
2012-11-15 19:25 ` [4/10] RFC: unconditionally include signal.h Tom Tromey
2012-11-16 17:18 ` Pedro Alves
2012-11-17 1:25 ` Joel Brobecker
2012-11-17 8:15 ` Eli Zaretskii
2012-11-19 15:05 ` Pedro Alves
2012-11-27 20:14 ` Tom Tromey
2012-11-15 19:26 ` [5/10] RFC: don't check for stddef.h Tom Tromey
2012-11-15 19:28 ` [6/10] RFC: don't check for stdlib.h Tom Tromey
2012-11-15 19:29 ` [7/10] RFC: don't check for unistd.h Tom Tromey
2012-11-15 19:31 ` [8/10] RFC: don't check for sys/types.h Tom Tromey
2012-11-15 19:33 ` [2/10] RFC: remove gdb_string.h Tom Tromey
2012-11-15 20:08 ` Eli Zaretskii
2012-11-15 20:22 ` Tom Tromey
2012-11-15 20:34 ` Eli Zaretskii
2012-11-16 2:42 ` Joel Brobecker
2012-11-15 19:33 ` [9/10] RFC: remove gdb_stat.h Tom Tromey
2012-11-15 20:32 ` [10/10] RFC: remove gdb_wait.h Tom Tromey
2012-11-15 20:54 ` Eli Zaretskii
2012-11-15 21:08 ` Joel Brobecker
2012-11-16 8:18 ` Eli Zaretskii
2012-11-16 14:45 ` Joel Brobecker
2012-11-16 15:39 ` Eli Zaretskii
2012-11-16 17:28 ` Pedro Alves
2012-11-16 17:52 ` Eli Zaretskii
2012-11-16 18:10 ` Pedro Alves
2012-11-16 18:26 ` Eli Zaretskii
2012-11-17 2:30 ` Joel Brobecker
2012-11-19 15:09 ` Pedro Alves
2012-11-16 17:55 ` [0/10] RFC: use gnulib more heavily + more configure fixes Pedro Alves
2012-11-27 21:24 ` Tom Tromey
2012-12-10 20:41 ` Tom Tromey
2012-12-11 3:11 ` Joel Brobecker
2012-12-11 10:53 ` Pedro Alves
2012-12-17 19:39 ` Tom Tromey
2013-01-03 18:25 ` Tom Tromey
2013-01-03 18:42 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r4nuy8lw.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox