From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20943 invoked by alias); 15 Nov 2012 19:22:29 -0000 Received: (qmail 20934 invoked by uid 22791); 15 Nov 2012 19:22:28 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 15 Nov 2012 19:22:21 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qAFJMLnV005127 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 15 Nov 2012 14:22:21 -0500 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qAFJMJwh000727 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 15 Nov 2012 14:22:20 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Subject: [3/10] RFC: remove gdb_dirent.h References: <87obiyzns7.fsf@fleche.redhat.com> Date: Thu, 15 Nov 2012 19:22:00 -0000 In-Reply-To: <87obiyzns7.fsf@fleche.redhat.com> (Tom Tromey's message of "Thu, 15 Nov 2012 12:09:12 -0700") Message-ID: <87r4nuy8lw.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-11/txt/msg00425.txt.bz2 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 . (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 . - 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 . */ - -#ifndef GDB_DIRENT_H -#define GDB_DIRENT_H 1 - -/* See description of `AC_HEADER_DIRENT' in the Autoconf manual. */ -#ifdef HAVE_DIRENT_H -# include /* 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 -# endif -# ifdef HAVE_SYS_DIR_H -# include -# endif -# ifdef HAVE_NDIR_H -# include -# 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 + +#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 #include "gdb_wait.h" #include -#include "gdb_dirent.h" +#include #include 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 #include -#include "gdb_dirent.h" +#include #include "xml-support.h" #include "terminal.h" #include 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 #include #include -#include "gdb_dirent.h" +#include #include #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 -#include "gdb_dirent.h" /* opendir/readdir, for listing the LWP's */ +#include /* opendir/readdir, for listing the LWP's */ #endif #include /* for O_RDONLY */ -- 1.7.7.6