From 0eceb61cc0a86238a2cc74b172ea790156153cf3 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Sun, 6 Oct 2024 18:50:51 -0500 Subject: 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. --- apps/openssl/compat/poll_win.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apps') 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) timespent_ms = 0; wait_rc = WAIT_FAILED; - if (timeout_ms < 0) + looptime_ms = (timeout_ms > 100 || timeout_ms == -1) ? 100 : timeout_ms; + if (timeout_ms == -1) timeout_ms = INFINITE; - looptime_ms = timeout_ms > 100 ? 100 : timeout_ms; do { struct timeval tv; -- cgit v1.2.3-55-g6feb