gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r36859 - libmicrohttpd/src/microhttpd


From: gnunet
Subject: [GNUnet-SVN] r36859 - libmicrohttpd/src/microhttpd
Date: Thu, 21 Jan 2016 18:37:41 +0100

Author: Karlson2k
Date: 2016-01-21 18:37:41 +0100 (Thu, 21 Jan 2016)
New Revision: 36859

Modified:
   libmicrohttpd/src/microhttpd/daemon.c
Log:
Fixed making sockets non-blocking.

Modified: libmicrohttpd/src/microhttpd/daemon.c
===================================================================
--- libmicrohttpd/src/microhttpd/daemon.c       2016-01-21 16:38:41 UTC (rev 
36858)
+++ libmicrohttpd/src/microhttpd/daemon.c       2016-01-21 17:37:41 UTC (rev 
36859)
@@ -184,10 +184,10 @@
 #else  /* MHD_POSIX_SOCKETS */
   int flags;
 
-  flags = fcntl (sock, F_GETFD);
+  flags = fcntl (sock, F_GETFL);
   if ( ( (-1 == flags) ||
         ( (flags != (flags | O_NONBLOCK)) &&
-          (0 != fcntl (sock, F_SETFD, flags | O_NONBLOCK)) ) ) )
+          (0 != fcntl (sock, F_SETFL, flags | O_NONBLOCK)) ) ) )
     {
 #ifdef HAVE_MESSAGES
       MHD_DLOG (daemon,
@@ -1904,24 +1904,8 @@
 make_nonblocking_noninheritable (struct MHD_Daemon *daemon,
                                 MHD_socket sock)
 {
-#ifdef MHD_WINSOCK_SOCKETS
   (void)make_nonblocking (daemon, sock);
   (void)make_noninheritable (daemon, sock);
-#else
-  int flags;
-
-  flags = fcntl (sock, F_GETFD);
-  if ( ( (-1 == flags) ||
-        ( (flags != (flags | O_NONBLOCK | FD_CLOEXEC)) &&
-          (0 != fcntl (sock, F_SETFD, flags | O_NONBLOCK | FD_CLOEXEC)) ) ) )
-    {
-#ifdef HAVE_MESSAGES
-      MHD_DLOG (daemon,
-               "Failed to make socket non-blocking non-inheritable: %s\n",
-               MHD_socket_last_strerr_ ());
-#endif
-    }
-#endif
 }
 
 




reply via email to

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