diff options
author | jerenkrantz <jerenkrantz@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-28 17:09:06 +0000 |
---|---|---|
committer | jerenkrantz <jerenkrantz@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-28 17:09:06 +0000 |
commit | 325f624dbc8afcece15191722cb35f885a13fdbd (patch) | |
tree | 6979cdf09441ce938ee27410ad299fdb3d851b82 /poll | |
parent | 5e135dce33e9ed6a1d6c439672f7ca5ae9fe6159 (diff) | |
download | libapr-325f624dbc8afcece15191722cb35f885a13fdbd.tar.gz |
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.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@689896 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poll')
-rw-r--r-- | poll/unix/select.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/poll/unix/select.c b/poll/unix/select.c index cf4a50692..6115820b9 100644 --- a/poll/unix/select.c +++ b/poll/unix/select.c @@ -453,6 +453,17 @@ APR_DECLARE(apr_status_t) apr_pollset_poll(apr_pollset_t *pollset, 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; } |