apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerenkra...@apache.org
Subject svn commit: r689897 - in /apr/apr/branches/1.3.x: CHANGES poll/unix/select.c
Date Thu, 28 Aug 2008 17:13:47 GMT
Author: jerenkrantz
Date: Thu Aug 28 10:13:46 2008
New Revision: 689897

URL: http://svn.apache.org/viewvc?rev=689897&view=rev
Log:
Backport r689896 from trunk:

Win32: Do not error out on apr_pollset_poll() when there are no sockets.

* poll/unix/select.c
  (apr_pollset_poll): On Win32, short-circuit success if we have no sockets
  instead of returning an error.
* CHANGES: Update.

Modified:
    apr/apr/branches/1.3.x/CHANGES
    apr/apr/branches/1.3.x/poll/unix/select.c

Modified: apr/apr/branches/1.3.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.3.x/CHANGES?rev=689897&r1=689896&r2=689897&view=diff
==============================================================================
--- apr/apr/branches/1.3.x/CHANGES [utf-8] (original)
+++ apr/apr/branches/1.3.x/CHANGES [utf-8] Thu Aug 28 10:13:46 2008
@@ -1,7 +1,8 @@
                                                      -*- coding: utf-8 -*-
 Changes for APR 1.3.4
 
-
+  *) Win32: Do not error out on apr_pollset_poll() when there are no sockets.
+     [Justin Erenkrantz]
 
 Changes for APR 1.3.3
 

Modified: apr/apr/branches/1.3.x/poll/unix/select.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.3.x/poll/unix/select.c?rev=689897&r1=689896&r2=689897&view=diff
==============================================================================
--- apr/apr/branches/1.3.x/poll/unix/select.c (original)
+++ apr/apr/branches/1.3.x/poll/unix/select.c Thu Aug 28 10:13:46 2008
@@ -340,6 +340,17 @@
     struct timeval tv, *tvptr;
     fd_set readset, writeset, exceptset;
 
+#ifdef WIN32
+    /* On Win32, select() must be presented with at least one socket to
+     * poll on, or select() will return WSAEINVAL.  So, we'll just
+     * short-circuit and bail now.
+     */
+    if (pollset->nelts == 0) {
+        (*num) = 0;
+        return APR_SUCCESS;
+    }
+#endif
+
     if (timeout < 0) {
         tvptr = NULL;
     }



Mime
View raw message