From: Bruno Haible <bruno@clisp.org>
Date: Fri, 23 Mar 2007 02:08:42 +0000 (+0000)
Subject: Fix a compilation error on BeOS.
X-Git-Tag: cvs-readonly~719
X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=641f40488e71b69b18f999ed913040382dfc825c;p=gnulib.git

Fix a compilation error on BeOS.
---

diff --git a/ChangeLog b/ChangeLog
index 25fe126022..92ebab0818 100644
--- 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.
diff --git a/modules/sys_socket-tests b/modules/sys_socket-tests
index 9a23162805..bce231e35c 100644
--- a/modules/sys_socket-tests
+++ b/modules/sys_socket-tests
@@ -4,6 +4,7 @@ tests/test-sys_socket.c
 Depends-on:
 
 configure.ac:
+AC_CHECK_FUNCS([shutdown])
 
 Makefile.am:
 TESTS += test-sys_socket
diff --git a/tests/test-sys_socket.c b/tests/test-sys_socket.c
index 69ae4c71f9..385cc5d2c8 100644
--- a/tests/test-sys_socket.c
+++ b/tests/test-sys_socket.c
@@ -23,14 +23,16 @@
 
 #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: