From 03544acfec87e60ac85c44f06d63ba127f574458 Mon Sep 17 00:00:00 2001 From: Gabriel Marin Date: Mon, 18 Aug 2025 21:18:15 +0300 Subject: [PATCH] easy: added CURLcode as func parameter and return if unrecoverable --- lib/easy.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/easy.c b/lib/easy.c index 9bd08d45b0..7aa0ee3635 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -573,7 +573,8 @@ static unsigned int populate_fds(struct pollfd *fds, struct events *ev) */ static int poll_fds(struct events *ev, struct pollfd *fds, - const unsigned int numfds) + const unsigned int numfds, + CURLcode *result) { int pollrc; @@ -588,7 +589,7 @@ static int poll_fds(struct events *ev, numfds, ev->ms, pollrc); #endif if(pollrc < 0) - return CURLE_UNRECOVERABLE_POLL; + *result = CURLE_UNRECOVERABLE_POLL; } else { #if DEBUG_EV_POLL @@ -621,7 +622,9 @@ static CURLcode wait_or_timeout(struct Curl_multi *multi, struct events *ev) /* get the time stamp to use to figure out how long poll takes */ before = curlx_now(); - pollrc = poll_fds(ev, fds, numfds); + pollrc = poll_fds(ev, fds, numfds, &result); + if(result == CURLE_UNRECOVERABLE_POLL) + return result; ev->msbump = FALSE; /* reset here */