select tests: Use existing modules.
authorBruno Haible <bruno@clisp.org>
Mon, 27 Dec 2010 17:51:03 +0000 (18:51 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 27 Dec 2010 17:51:03 +0000 (18:51 +0100)
* modules/select-tests (Depends-on): Add pipe-posix, unistd.
(configure.ac): Don't test for unistd.h.
* tests/test-select.c: Include <unistd.h> always. Use pipe() as
declared in <unistd.h>.

ChangeLog
modules/select-tests
tests/test-select.c

index 7aef83f..cd12d70 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2010-12-27  Bruno Haible  <bruno@clisp.org>
 
+       select tests: Use existing modules.
+       * modules/select-tests (Depends-on): Add pipe-posix, unistd.
+       (configure.ac): Don't test for unistd.h.
+       * tests/test-select.c: Include <unistd.h> always. Use pipe() as
+       declared in <unistd.h>.
+
+2010-12-27  Bruno Haible  <bruno@clisp.org>
+
        mbrtowc: Work around a Solaris 7 bug.
        * m4/mbrtowc.m4 (gl_MBRTOWC_NULL_ARG1): New macro.
        (gl_MBRTOWC_NULL_ARG2): Renamed from gl_MBRTOWC_NULL_ARG.
index 566e4d9..52e3452 100644 (file)
@@ -11,11 +11,13 @@ Depends-on:
 stdbool
 netinet_in
 arpa_inet
+unistd
 sys_ioctl
 extensions
 inet_pton
 errno
 perror
+pipe-posix
 socket
 bind
 setsockopt
@@ -27,7 +29,7 @@ close
 gettimeofday
 
 configure.ac:
-AC_CHECK_HEADERS_ONCE([unistd.h sys/wait.h])
+AC_CHECK_HEADERS_ONCE([sys/wait.h])
 
 Makefile.am:
 TESTS += test-select test-select-in.sh test-select-out.sh
index b9b3f84..bc5c1a9 100644 (file)
@@ -42,6 +42,7 @@ SIGNATURE_CHECK (FD_ZERO, void, (fd_set *));
 #include <string.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
+#include <unistd.h>
 #include <fcntl.h>
 #include <stdlib.h>
 #include <stdbool.h>
@@ -56,19 +57,12 @@ enum { SEL_IN = 1, SEL_OUT = 2, SEL_EXC = 4 };
 # define WIN32_NATIVE
 #endif
 
-#ifdef WIN32_NATIVE
-#include <io.h>
-#define pipe(x) _pipe(x, 256, O_BINARY)
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
 #ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
+# include <sys/wait.h>
 #endif
 
 #ifndef SO_REUSEPORT
-#define SO_REUSEPORT    SO_REUSEADDR
+# define SO_REUSEPORT    SO_REUSEADDR
 #endif
 
 #define TEST_PORT       12345