diff options
author | Yann Ylavic <ylavic@apache.org> | 2015-03-20 01:02:14 +0000 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2015-03-20 01:02:14 +0000 |
commit | 44368cd4ee60860484d668c618734908396454cd (patch) | |
tree | e4218c3c1f923ee459bd3039f92077ae61380fda /poll | |
parent | 2531d199c3f1c619a52c95e31a05d9d860082c33 (diff) | |
download | apr-44368cd4ee60860484d668c618734908396454cd.tar.gz |
Follow up to r1089433: handle impl_pollcb_poll().
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1667915 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poll')
-rw-r--r-- | poll/unix/poll.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 4414ee107..0764d5f98 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -397,12 +397,23 @@ static apr_status_t impl_pollcb_poll(apr_pollcb_t *pollcb, apr_status_t rv = APR_SUCCESS; apr_uint32_t i; +#ifdef WIN32 + /* WSAPoll() requires at least one socket. */ + if (pollcb->nelts == 0) { + if (timeout > 0) { + apr_sleep(timeout); + return APR_TIMEUP; + } + return APR_SUCCESS; + } if (timeout > 0) { timeout /= 1000; } -#ifdef WIN32 ret = WSAPoll(pollcb->pollset.ps, pollcb->nelts, (int)timeout); #else + if (timeout > 0) { + timeout /= 1000; + } ret = poll(pollcb->pollset.ps, pollcb->nelts, timeout); #endif if (ret < 0) { |