changeset 8499:7304ea530640

Fix a compilation error on BeOS.
author Bruno Haible <bruno@clisp.org>
date Fri, 23 Mar 2007 02:08:42 +0000
parents accc767de343
children 6c3093c67379
files ChangeLog modules/sys_socket-tests tests/test-sys_socket.c
diffstat 3 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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.
--- a/modules/sys_socket-tests
+++ b/modules/sys_socket-tests
@@ -4,6 +4,7 @@
 Depends-on:
 
 configure.ac:
+AC_CHECK_FUNCS([shutdown])
 
 Makefile.am:
 TESTS += test-sys_socket
--- 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: