aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/openssl/compat/poll_win.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/apps/openssl/compat/poll_win.c b/apps/openssl/compat/poll_win.c
index 30f6b60..c518962 100644
--- a/apps/openssl/compat/poll_win.c
+++ b/apps/openssl/compat/poll_win.c
@@ -249,8 +249,6 @@ poll(struct pollfd *pfds, nfds_t nfds, int timeout_ms)
249 wait_rc = WAIT_FAILED; 249 wait_rc = WAIT_FAILED;
250 250
251 looptime_ms = (timeout_ms > 100 || timeout_ms == -1) ? 100 : timeout_ms; 251 looptime_ms = (timeout_ms > 100 || timeout_ms == -1) ? 100 : timeout_ms;
252 if (timeout_ms == -1)
253 timeout_ms = INFINITE;
254 252
255 do { 253 do {
256 TIMEVAL tv; 254 TIMEVAL tv;
@@ -280,7 +278,7 @@ poll(struct pollfd *pfds, nfds_t nfds, int timeout_ms)
280 /* 278 /*
281 * If we signaled on a file handle, don't wait on the sockets. 279 * If we signaled on a file handle, don't wait on the sockets.
282 */ 280 */
283 if (wait_rc >= WAIT_OBJECT_0 && 281 if (num_handles && wait_rc >= WAIT_OBJECT_0 &&
284 (wait_rc <= WAIT_OBJECT_0 + num_handles - 1)) { 282 (wait_rc <= WAIT_OBJECT_0 + num_handles - 1)) {
285 tv.tv_usec = 0; 283 tv.tv_usec = 0;
286 handle_signaled = 1; 284 handle_signaled = 1;
@@ -298,7 +296,7 @@ poll(struct pollfd *pfds, nfds_t nfds, int timeout_ms)
298 296
299 timespent_ms += looptime_ms; 297 timespent_ms += looptime_ms;
300 298
301 } while (timespent_ms < timeout_ms); 299 } while (timeout_ms == -1 || timespent_ms < timeout_ms);
302 300
303 rc = 0; 301 rc = 0;
304 num_handles = 0; 302 num_handles = 0;