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 7aef83f68087eeb6a89dc219710efaae00748b2c..cd12d7002a2c054ffad1951de976cfee43ddb4d6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+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.
index 566e4d9595f0d5dc512fed89677841ce373748b0..52e34523d86e17a0f99f4a50ceaee1cf3fe61290 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 b9b3f844b73a54781ddd27ab34d0586073d4fedf..bc5c1a9365bda6b5aabd0f202bbcc7109b3b259b 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