From bc7dea8de974648cd4e38d154abcca6879e630cc Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Mon, 1 Jul 2013 11:19:27 +0000 Subject: [PATCH] Rely on gnulib's unistd.h replacement. With gnulib's unistd module, we can assume unistd.h is always present, and that STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO are always defined. Don't remove unistd.h from GDB's configure.ac, as later tests in the file use HAVE_UNISTD_H checks. gdb/ 2013-07-01 Pedro Alves * defs.h: Don't check HAVE_UNISTD_H before including . (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): Delete. * tracepoint.c: Don't check HAVE_UNISTD_H before including . gdb/gdbserver/ 2013-07-01 Pedro Alves * event-loop.c: Don't check HAVE_UNISTD_H before including . * gdbreplay.c: Likewise. * remote-utils.c: Likewise. * server.c: Likewise. * configure.ac: Don't check for unistd.h. * configure: Regenerate. --- gdb/ChangeLog | 7 +++++++ gdb/defs.h | 14 -------------- gdb/gdbserver/ChangeLog | 10 ++++++++++ gdb/gdbserver/configure | 2 +- gdb/gdbserver/configure.ac | 2 +- gdb/gdbserver/event-loop.c | 2 -- gdb/gdbserver/gdbreplay.c | 2 -- gdb/gdbserver/remote-utils.c | 2 -- gdb/gdbserver/server.c | 2 -- gdb/tracepoint.c | 2 -- 10 files changed, 19 insertions(+), 26 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index de97647..7292d8b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,12 @@ 2013-07-01 Pedro Alves + * defs.h: Don't check HAVE_UNISTD_H before including . + (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): Delete. + * tracepoint.c: Don't check HAVE_UNISTD_H before including + . + +2013-07-01 Pedro Alves + Import the "unistd" gnulib module. * gnulib/update-gnulib.sh (IMPORTED_GNULIB_MODULES): Add "unistd". * gnulib/Makefile.in (aclocal_m4_deps): Add import/m4/off_t.m4, diff --git a/gdb/defs.h b/gdb/defs.h index d8a1adb..f90ca9d 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -52,10 +52,7 @@ #include #endif -#ifdef HAVE_UNISTD_H #include -#endif - #include /* First include ansidecl.h so we can use the various macro definitions @@ -766,17 +763,6 @@ extern int use_windows; #define MERGEPID(PID, TID) ptid_build (PID, TID, 0) #endif -/* Define well known filenos if the system does not define them. */ -#ifndef STDIN_FILENO -#define STDIN_FILENO 0 -#endif -#ifndef STDOUT_FILENO -#define STDOUT_FILENO 1 -#endif -#ifndef STDERR_FILENO -#define STDERR_FILENO 2 -#endif - /* If this definition isn't overridden by the header files, assume that isatty and fileno exist on this system. */ #ifndef ISATTY diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 8f73480..11ae9f3 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,13 @@ +2013-07-01 Pedro Alves + + * event-loop.c: Don't check HAVE_UNISTD_H before including + . + * gdbreplay.c: Likewise. + * remote-utils.c: Likewise. + * server.c: Likewise. + * configure.ac: Don't check for unistd.h. + * configure: Regenerate. + 2013-06-28 Tom Tromey * Makefile.in (version.c): Use version.in, not diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure index 0588c94..49b9ab6 100755 --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure @@ -4783,7 +4783,7 @@ $as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cach cd "$ac_popdir" -for ac_header in sgtty.h termio.h termios.h sys/reg.h string.h proc_service.h sys/procfs.h thread_db.h linux/elf.h stdlib.h unistd.h errno.h fcntl.h signal.h sys/file.h malloc.h sys/ioctl.h netinet/in.h sys/socket.h netdb.h netinet/tcp.h arpa/inet.h sys/wait.h wait.h sys/un.h linux/perf_event.h +for ac_header in sgtty.h termio.h termios.h sys/reg.h string.h proc_service.h sys/procfs.h thread_db.h linux/elf.h stdlib.h errno.h fcntl.h signal.h sys/file.h malloc.h sys/ioctl.h netinet/in.h sys/socket.h netdb.h netinet/tcp.h arpa/inet.h sys/wait.h wait.h sys/un.h linux/perf_event.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac index c983d41..2658bef 100644 --- a/gdb/gdbserver/configure.ac +++ b/gdb/gdbserver/configure.ac @@ -65,7 +65,7 @@ ACX_CONFIGURE_DIR(["../gnulib"], ["build-gnulib-gdbserver"]) AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl proc_service.h sys/procfs.h thread_db.h linux/elf.h dnl - stdlib.h unistd.h dnl + stdlib.h dnl errno.h fcntl.h signal.h sys/file.h malloc.h dnl sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl netinet/tcp.h arpa/inet.h sys/wait.h wait.h sys/un.h dnl diff --git a/gdb/gdbserver/event-loop.c b/gdb/gdbserver/event-loop.c index 9e172a9..fbe7898 100644 --- a/gdb/gdbserver/event-loop.c +++ b/gdb/gdbserver/event-loop.c @@ -34,9 +34,7 @@ #include #endif -#ifdef HAVE_UNISTD_H #include -#endif typedef struct gdb_event gdb_event; typedef int (event_handler_func) (gdb_fildes_t); diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c index c0d0c8f..5e64f6d 100644 --- a/gdb/gdbserver/gdbreplay.c +++ b/gdb/gdbserver/gdbreplay.c @@ -41,9 +41,7 @@ #ifdef HAVE_STRING_H #include #endif -#ifdef HAVE_UNISTD_H #include -#endif #ifdef HAVE_NETINET_IN_H #include #endif diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c index 3f055cf..5cd6fa1 100644 --- a/gdb/gdbserver/remote-utils.c +++ b/gdb/gdbserver/remote-utils.c @@ -51,9 +51,7 @@ #include #endif #include -#if HAVE_UNISTD_H #include -#endif #if HAVE_ARPA_INET_H #include #endif diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c index 4a1d1dc..a172c98 100644 --- a/gdb/gdbserver/server.c +++ b/gdb/gdbserver/server.c @@ -22,9 +22,7 @@ #include "notif.h" #include "tdesc.h" -#if HAVE_UNISTD_H #include -#endif #if HAVE_SIGNAL_H #include #endif diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 954aa13..054372a 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -64,9 +64,7 @@ /* readline defines this. */ #undef savestring -#ifdef HAVE_UNISTD_H #include -#endif #ifndef O_LARGEFILE #define O_LARGEFILE 0 -- 2.7.4