This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
ser-pipe.c portability fix
- To: gdb-patches@sourceware.cygnus.com (gdb-patches@sourceware.cygnus.com)
- Subject: ser-pipe.c portability fix
- From: "Philippe De Muyter" <phdm@macqel.be>
- Date: Mon, 19 Jul 1999 10:48:33 +0200 (CEST)
ser-pipe.c fails to compile on sysV68. Here is a fix.
Mon Jul 19 10:46:18 1999 Philippe De Muyter <phdm@macqel.be>
* ser-pipe.c (sys/wait.h): Include this file only #if HAVE_SYS_WAIT_H.
(STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO): Macros defined if needed.
--- ./gdb/ser-pipe.c Mon Jul 19 10:25:13 1999
+++ ./gdb/ser-pipe.c Thu Jul 15 13:25:51 1999
@@ -23,12 +23,25 @@
#include "defs.h"
#include "serial.h"
#include <sys/types.h>
+#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
+#endif
#include <sys/socket.h>
#include <sys/time.h>
#include <fcntl.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#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
#include "signals.h"