Skip to content

Instantly share code, notes, and snippets.

@bagder
Created August 20, 2021 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bagder/62208085f8229035924aa90f873d4c50 to your computer and use it in GitHub Desktop.
Save bagder/62208085f8229035924aa90f873d4c50 to your computer and use it in GitHub Desktop.
select.c fix for clearing revents
diff --git a/lib/select.c b/lib/select.c
index 52dca5a2c..3be32ceb5 100644
--- a/lib/select.c
+++ b/lib/select.c
@@ -344,10 +344,11 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, timediff_t timeout_ms)
for(i = 0; i < nfds; i++) {
if(ufds[i].fd != CURL_SOCKET_BAD) {
fds_none = FALSE;
break;
}
+ ufds[i].revents = 0;
}
}
if(fds_none) {
/* no sockets, just wait */
return Curl_wait_ms(timeout_ms);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment