gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r28379 - in libmicrohttpd: . src/microhttpd


From: gnunet
Subject: [GNUnet-SVN] r28379 - in libmicrohttpd: . src/microhttpd
Date: Fri, 2 Aug 2013 14:37:09 +0200

Author: LRN
Date: 2013-08-02 14:37:08 +0200 (Fri, 02 Aug 2013)
New Revision: 28379

Modified:
   libmicrohttpd/configure.ac
   libmicrohttpd/src/microhttpd/daemon.c
Log:
Fix compiling for systems without SOCK_NONBLOCK


Modified: libmicrohttpd/configure.ac
===================================================================
--- libmicrohttpd/configure.ac  2013-08-02 11:59:26 UTC (rev 28378)
+++ libmicrohttpd/configure.ac  2013-08-02 12:37:08 UTC (rev 28379)
@@ -232,6 +232,28 @@
 AC_CHECK_FUNCS_ONCE(memmem)
 AC_CHECK_FUNCS_ONCE(accept4)
 
+AC_COMPILE_IFELSE(
+  [AC_LANG_PROGRAM(
+                   [
+                    #if defined HAVE_SYS_TYPES_H
+                    #  include <sys/types.h>      
+                    #endif
+                    #if defined HAVE_SYS_SOCKET_H
+                    #  include <sys/socket.h>
+                    #elif defined HAVE_WINSOCK2_H
+                    #  include <winsock2.h>
+                    #endif],
+                   [
+                    #ifndef SOCK_NONBLOCK
+                    # error do not have SOCK_NONBLOCK
+                    #endif
+                   ])
+  ],
+  [
+    AC_DEFINE([HAVE_SOCK_NONBLOCK], [1], [SOCK_NONBLOCK is defined in a socket 
header])
+  ])
+
+
 AC_SEARCH_LIBS([clock_gettime], [rt], [
                                AC_DEFINE(HAVE_CLOCK_GETTIME, 1, [Have 
clock_gettime])
 ])

Modified: libmicrohttpd/src/microhttpd/daemon.c
===================================================================
--- libmicrohttpd/src/microhttpd/daemon.c       2013-08-02 11:59:26 UTC (rev 
28378)
+++ libmicrohttpd/src/microhttpd/daemon.c       2013-08-02 12:37:08 UTC (rev 
28379)
@@ -1329,7 +1329,11 @@
   memset (addr, 0, sizeof (addrstorage));
   if (-1 == (fd = daemon->socket_fd))
     return MHD_NO;
+#ifdef HAVE_SOCK_NONBLOCK
   nonblock = SOCK_NONBLOCK;
+#else
+  nonblock = 0;
+#endif
 #ifdef CYGWIN
   if (0 == (daemon->options & MHD_USE_SSL))
     nonblock = 0;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]