Przeglądaj źródła

BS: fixing compilation problem on MinGW

Christian Grothoff 14 lat temu
rodzic
commit
912620e3f9
3 zmienionych plików z 15 dodań i 0 usunięć
  1. 1 0
      AUTHORS
  2. 3 0
      ChangeLog
  3. 11 0
      src/daemon/daemon.c

+ 1 - 0
AUTHORS

@@ -37,6 +37,7 @@ Will Bryant <[email protected]>
 LRN <[email protected]>
 Sven Geggus <[email protected]>
 Steve Wolf <[email protected]>
+Brecht Sanders <[email protected]>
 
 Documentation contributions also came from:
 Marco Maggi <[email protected]>

+ 3 - 0
ChangeLog

@@ -1,3 +1,6 @@
+Wed Feb  1 09:39:12 CET 2012
+	Fixed compilation problem on MinGW. -BS
+
 Tue Jan 31 17:50:24 CET 2012
 	Releasing 0.9.19. -CG
 

+ 11 - 0
src/daemon/daemon.c

@@ -956,6 +956,7 @@ MHD_add_connection (struct MHD_Daemon *daemon,
 #endif
   {
     /* make socket non-blocking */
+#ifndef MINGW
     int flags = fcntl (connection->socket_fd, F_GETFL);
     if ( (flags == -1) ||
 	 (0 != fcntl (connection->socket_fd, F_SETFL, flags | O_NONBLOCK)) )
@@ -963,6 +964,16 @@ MHD_add_connection (struct MHD_Daemon *daemon,
 #if HAVE_MESSAGES
 	FPRINTF(stderr, "Failed to make socket non-blocking: %s\n", 
 		STRERROR (errno));
+#endif
+      }
+#else
+    unsigned long flags = 1;
+    if (0 != ioctlsocket (connection->socket_fd, FIONBIO, &flags))
+#endif
+      {
+#if HAVE_MESSAGES
+	FPRINTF(stderr, "Failed to make socket non-blocking: %s\n", 
+		STRERROR (errno));
 #endif
       }
   }