This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: ser-pipe.c portability fix
- To: Philippe De Muyter <phdm@macqel.be>
- Subject: Re: ser-pipe.c portability fix
- From: Andrew Cagney <ac131313@cygnus.com>
- Date: Thu, 05 Aug 1999 21:14:42 +1000
- CC: "gdb-patches@sourceware.cygnus.com" <gdb-patches@sourceware.cygnus.com>
- Organization: Cygnus Solutions
- References: <199907190848.KAA21870@mail.macqel.be>
FYI,
I've checked the attached, along with a mod to configure.in that tests
for socketpair(), into GDB. This means that things should compile on
your host. I'll next look at libiberty/socketpair.c
Andrew
Philippe De Muyter wrote:
>
> 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"