[RFA] ser-tcp.c Solaris fix

Martin M. Hunt
2001-12-07T08:10:42Z

I made a last-minute change to my previous patch and never rechecked
on Solaris, so of course it doesn't compile. I checked this fix on
Linux, Solaris, and cygwin.

--
Martin Hunt
GDB Engineer
Red Hat, Inc.

2001-12-07 Martin M. Hunt <hunt@redhat.com>

* configure.in: Check for sys/filio.h
* configure: Rebuild.
* config.in: Add HAVE_SYS_FILIO_H
* ser-tcp.c: Conditionally include sys/filio.h.

Index: config.in
===================================================================
RCS file: /cvs/src/src/gdb/config.in,v
retrieving revision 1.30
diff -u -p -r1.30 config.in
--- config.in 2001/08/27 22:39:55 1.30
+++ config.in 2001/12/07 08:09:26
@@ -343,6 +343,9 @@
/* Define if you have the <sys/ioctl.h> header file. */
#undef HAVE_SYS_IOCTL_H

+/* Define if you have the <sys/filio.h> header file. */
+#undef HAVE_SYS_FILIO_H
+
/* Define if you have the <sys/ndir.h> header file. */
#undef HAVE_SYS_NDIR_H

Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.74
diff -u -p -r1.74 configure.in
--- configure.in 2001/11/05 23:54:49 1.74
+++ configure.in 2001/12/07 08:09:27
@@ -124,7 +124,7 @@ AC_CHECK_HEADERS(ctype.h endian.h nlist.
term.h termio.h termios.h unistd.h wait.h sys/wait.h \
wchar.h wctype.h asm/debugreg.h sys/debugreg.h sys/select.h \
time.h sys/file.h sys/ioctl.h sys/user.h sys/fault.h sys/syscall.h \
- dirent.h sys/ndir.h sys/dir.h ndir.h \
+ dirent.h sys/ndir.h sys/dir.h ndir.h sys/filio.h \
curses.h ncurses.h \
poll.h sys/poll.h)
AC_HEADER_STAT
Index: configure
===================================================================
RCS file: /cvs/src/src/gdb/configure,v
retrieving revision 1.72
diff -u -p -r1.72 configure
--- configure 2001/11/05 23:54:49 1.72
+++ configure 2001/12/07 08:09:29
@@ -3407,7 +3407,7 @@ for ac_hdr in ctype.h endian.h nlist.h l
term.h termio.h termios.h unistd.h wait.h sys/wait.h \
wchar.h wctype.h asm/debugreg.h sys/debugreg.h sys/select.h \
time.h sys/file.h sys/ioctl.h sys/user.h sys/fault.h sys/syscall.h \
- dirent.h sys/ndir.h sys/dir.h ndir.h \
+ dirent.h sys/ndir.h sys/dir.h ndir.h sys/filio.h \
curses.h ncurses.h \
poll.h sys/poll.h
do
Index: ser-tcp.c
===================================================================
RCS file: /cvs/src/src/gdb/ser-tcp.c,v
retrieving revision 1.8
diff -u -p -r1.8 ser-tcp.c
--- ser-tcp.c 2001/12/04 06:12:56 1.8
+++ ser-tcp.c 2001/12/07 08:09:29
@@ -24,7 +24,14 @@
#include "ser-unix.h"

#include <sys/types.h>
-#include <sys/ioctl.h>
+
+#ifdef HAVE_SYS_FILIO_H
+#include <sys/filio.h> /* For FIONBIO. */
+#endif
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h> /* For FIONBIO. */
+#endif
+
#include <sys/time.h>
#include <netinet/in.h>
#include <arpa/inet.h>