You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by je...@apache.org on 2008/08/28 19:13:47 UTC
svn commit: r689897 - in /apr/apr/branches/1.3.x: CHANGES poll/unix/select.c
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;
}