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:09:07 UTC
svn commit: r689896 - in /apr/apr/trunk: CHANGES poll/unix/select.c
Author: jerenkrantz
Date: Thu Aug 28 10:09:06 2008
New Revision: 689896
URL: http://svn.apache.org/viewvc?rev=689896&view=rev
Log:
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/trunk/CHANGES
apr/apr/trunk/poll/unix/select.c
Modified: apr/apr/trunk/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/trunk/CHANGES?rev=689896&r1=689895&r2=689896&view=diff
==============================================================================
--- apr/apr/trunk/CHANGES [utf-8] (original)
+++ apr/apr/trunk/CHANGES [utf-8] Thu Aug 28 10:09:06 2008
@@ -1,5 +1,9 @@
-*- coding: utf-8 -*-
Changes for APR 1.4.0
+
+ *) Win32: Do not error out on apr_pollset_poll() when there are no sockets.
+ [Justin Erenkrantz]
+
*) Intruduce apr_hash_do for iterating over a hash table.
[Mladen Turk]
Modified: apr/apr/trunk/poll/unix/select.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/select.c?rev=689896&r1=689895&r2=689896&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/select.c (original)
+++ apr/apr/trunk/poll/unix/select.c Thu Aug 28 10:09:06 2008
@@ -453,6 +453,17 @@
fd_set readset, writeset, exceptset;
apr_status_t rv = APR_SUCCESS;
+#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;
}