Fix a compilation error on BeOS.
authorBruno Haible <bruno@clisp.org>
Fri, 23 Mar 2007 02:08:42 +0000 (02:08 +0000)
committerBruno Haible <bruno@clisp.org>
Fri, 23 Mar 2007 02:08:42 +0000 (02:08 +0000)
ChangeLog
modules/sys_socket-tests
tests/test-sys_socket.c

index 25fe126022106aff6796dfef04f13826afa8916b..92ebab0818c0c3aacee40f9518ab215478fffee9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-03-22  Bruno Haible  <bruno@clisp.org>
+
+       * modules/sys_socket-tests (configure.ac): Check for shutdown function.
+       * tests/test-sys_socket.c (a): Test only if shutdown() exists.
+       (main): Update.
+       Fixes a compilation error on BeOS.
+
 2007-03-22  Bruno Haible  <bruno@clisp.org>
 
        * modules/frexpl-tests: New file.
index 9a231628055e713c1a6e63189f2031a7eafed807..bce231e35c9238e76810bf33589f1907435cd6e3 100644 (file)
@@ -4,6 +4,7 @@ tests/test-sys_socket.c
 Depends-on:
 
 configure.ac:
+AC_CHECK_FUNCS([shutdown])
 
 Makefile.am:
 TESTS += test-sys_socket
index 69ae4c71f9a3eda417ce749fb78464c9b2168aa0..385cc5d2c8e6ce032a7176e0fca08c860a71d49f 100644 (file)
 
 #include <errno.h>
 
+#if HAVE_SHUTDOWN
 /* Check some integer constant expressions.  */
 int a[] = { SHUT_RD, SHUT_WR, SHUT_RDWR };
+#endif
 
 int
 main ()
 {
   /* Check some errno values.  */
-  switch (a[0])
+  switch (0)
     {
     case ENOTSOCK:
     case EADDRINUSE: