gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r36885 - in libmicrohttpd: . src/include


From: gnunet
Subject: [GNUnet-SVN] r36885 - in libmicrohttpd: . src/include
Date: Sat, 30 Jan 2016 16:57:42 +0100

Author: Karlson2k
Date: 2016-01-30 16:57:42 +0100 (Sat, 30 Jan 2016)
New Revision: 36885

Modified:
   libmicrohttpd/ChangeLog
   libmicrohttpd/src/include/platform_interface.h
Log:
Fix running select() on W32 with empty fdsets - W32 return error if no socket 
is marked in fdsets.

Modified: libmicrohttpd/ChangeLog
===================================================================
--- libmicrohttpd/ChangeLog     2016-01-29 14:21:05 UTC (rev 36884)
+++ libmicrohttpd/ChangeLog     2016-01-30 15:57:42 UTC (rev 36885)
@@ -1,3 +1,6 @@
+Sat Jan 30 15:49:07 CET 2016
+       Fix running select() with empty fdsets on W32. -EG
+
 Mon Jan 25 13:45:50 CET 2016
        Added check test for triggering select() on
        listen socket. -EG

Modified: libmicrohttpd/src/include/platform_interface.h
===================================================================
--- libmicrohttpd/src/include/platform_interface.h      2016-01-29 14:21:05 UTC 
(rev 36884)
+++ libmicrohttpd/src/include/platform_interface.h      2016-01-30 15:57:42 UTC 
(rev 36885)
@@ -108,7 +108,12 @@
 #if !defined(MHD_WINSOCK_SOCKETS)
 #define MHD_SYS_select_(n,r,w,e,t) select((n),(r),(w),(e),(t))
 #else
-#define MHD_SYS_select_(n,r,w,e,t) select((int)0,(r),(w),(e),(t))
+#define MHD_SYS_select_(n,r,w,e,t) \
+ ( (!(r) || ((fd_set*)(r))->fd_count == 0) && \
+   (!(w) || ((fd_set*)(w))->fd_count == 0) && \
+   (!(e) || ((fd_set*)(e))->fd_count == 0) ) ? \
+ ( (!(t)) ? (Sleep((t)->tv_sec * 1000 + (t)->tv_usec / 1000), 0) : 0 ) : \
+ (select((int)0,(r),(w),(e),(t)))
 #endif
 
 #if defined(HAVE_POLL)




reply via email to

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