aboutsummaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorBrent Cook <busterb@gmail.com>2024-10-06 18:50:51 -0500
committerBrent Cook <busterb@gmail.com>2024-10-06 18:56:01 -0500
commit0eceb61cc0a86238a2cc74b172ea790156153cf3 (patch)
treed8178ccf9951115c0c02abeefe299790066a2fff /apps
parent3467d6f282146d6e84d5d840d532fa6ec4536d64 (diff)
downloadportable-0eceb61cc0a86238a2cc74b172ea790156153cf3.tar.gz
portable-0eceb61cc0a86238a2cc74b172ea790156153cf3.tar.bz2
portable-0eceb61cc0a86238a2cc74b172ea790156153cf3.zip
for poll timeout -1, set loop time more reasonably
Otherwise it sets looptime to -1, which was skipped by select() and caused 100% cpu busy looping.
Diffstat (limited to 'apps')
-rw-r--r--apps/openssl/compat/poll_win.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/openssl/compat/poll_win.c b/apps/openssl/compat/poll_win.c
index c9422b9..83191e5 100644
--- a/apps/openssl/compat/poll_win.c
+++ b/apps/openssl/compat/poll_win.c
@@ -248,9 +248,9 @@ poll(struct pollfd *pfds, nfds_t nfds, int timeout_ms)
248 timespent_ms = 0; 248 timespent_ms = 0;
249 wait_rc = WAIT_FAILED; 249 wait_rc = WAIT_FAILED;
250 250
251 if (timeout_ms < 0) 251 looptime_ms = (timeout_ms > 100 || timeout_ms == -1) ? 100 : timeout_ms;
252 if (timeout_ms == -1)
252 timeout_ms = INFINITE; 253 timeout_ms = INFINITE;
253 looptime_ms = timeout_ms > 100 ? 100 : timeout_ms;
254 254
255 do { 255 do {
256 struct timeval tv; 256 struct timeval tv;