Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 4/9] Rely on gnulib's unistd.h replacement.
Date: Thu, 27 Jun 2013 18:52:00 -0000	[thread overview]
Message-ID: <20130627185229.6625.60141.stgit@brno.lan> (raw)
In-Reply-To: <20130627185200.6625.10526.stgit@brno.lan>

With gnulib's unistd module, we can assume unistd.h is always present, and that
STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO are always defined.

gdb/
2013-06-27  Pedro Alves  <palves@redhat.com>

	* defs.h: Don't check HAVE_UNISTD_H before including <unistd.h>.
	(STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): Delete.
	* tracepoint.c: Don't check HAVE_UNISTD_H before including
	<unistd.h>.

gdbserver/
2013-06-27  Pedro Alves  <palves@redhat.com>

	* event-loop.c: Don't check HAVE_UNISTD_H before including
	<unistd.h>.
	* gdbreplay.c: Likewise.
	* remote-utils.c: Likewise.
	* server.c: Likewise.
---
 gdb/defs.h                   |   14 --------------
 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 --
 6 files changed, 24 deletions(-)

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 <stddef.h>
 #endif
 
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
-
 #include <fcntl.h>
 
 /* 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/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 <errno.h>
 #endif
 
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#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 <string.h>
 #endif
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #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 <fcntl.h>
 #endif
 #include <sys/time.h>
-#if HAVE_UNISTD_H
 #include <unistd.h>
-#endif
 #if HAVE_ARPA_INET_H
 #include <arpa/inet.h>
 #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 <unistd.h>
-#endif
 #if HAVE_SIGNAL_H
 #include <signal.h>
 #endif
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index bbba2f8..b8451e5 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -64,9 +64,7 @@
 /* readline defines this.  */
 #undef savestring
 
-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif
 
 #ifndef O_LARGEFILE
 #define O_LARGEFILE 0


  parent reply	other threads:[~2013-06-27 18:52 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-27 18:52 [PATCH 00/09] Import unistd and pathmax gnulib modules Pedro Alves
2013-06-27 18:52 ` [PATCH 5/9] Constify main.c:get_init_files Pedro Alves
2013-06-27 18:52 ` [PATCH 6/9] Reimplement DJGPP's .gdbinit -> gdb.ini renaming Pedro Alves
2013-06-27 18:52 ` [PATCH 3/9] Import the "unistd" gnulib module Pedro Alves
2013-06-27 18:52 ` Pedro Alves [this message]
2013-06-28  9:05   ` [PATCH 4/9] Rely on gnulib's unistd.h replacement Yao Qi
2013-06-28 17:44     ` Pedro Alves
2013-06-28 18:11       ` Pedro Alves
2013-06-27 18:52 ` [PATCH 1/9] Reimport gnulib from scratch Pedro Alves
2013-06-28  8:49   ` Yao Qi
2013-06-28  9:55     ` Pedro Alves
2013-06-28 12:10       ` Yao Qi
2013-06-28 12:28         ` Pedro Alves
2013-06-27 18:52 ` [PATCH 2/9] utils.c: pathconf call, check for _PC_PATH_MAX instead of HAVE_UNISTD_H Pedro Alves
2013-06-27 18:53 ` [PATCH 7/9] Import the "pathmax" gnulib module Pedro Alves
2013-06-27 18:53 ` [PATCH 8/9] Normalize on PATH_MAX instead of MAXPATHLEN throughout Pedro Alves
2013-06-28 15:21   ` Tom Tromey
2013-06-28 18:06     ` Pedro Alves
2013-06-28 19:08       ` Tom Tromey
2013-06-27 18:59 ` [PATCH 9/9] [GDBserver] hostio.c: Fallback to packet buffer size if PATH_MAX is not available Pedro Alves
2013-06-28 15:43 ` [PATCH 00/09] Import unistd and pathmax gnulib modules Tom Tromey
2013-07-01 11:31 ` Pedro Alves

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=20130627185229.6625.60141.stgit@brno.lan \
    --to=palves@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