ser-pipe.c portability fix

Philippe De Muyter phdm@macqel.be
Mon Jul 19 01:48:00 GMT 1999


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"


More information about the Gdb-patches mailing list