From 5778aa97d83887707e8d097c569d382b9ceddae4 Mon Sep 17 00:00:00 2001 From: Paul-Louis Ageneau Date: Thu, 12 Sep 2024 13:52:06 +0200 Subject: [PATCH] Prevent poll service failure with WSAENOTSOCK on Windows --- src/impl/pollservice.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/impl/pollservice.cpp b/src/impl/pollservice.cpp index c03e6fc41..ae4daa22b 100644 --- a/src/impl/pollservice.cpp +++ b/src/impl/pollservice.cpp @@ -189,12 +189,13 @@ void PollService::runLoop() { } while (ret < 0 && (sockerrno == SEINTR || sockerrno == SEAGAIN)); + if (ret < 0) { #ifdef _WIN32 - if (ret == WSAENOTSOCK) - continue; // prepare again as the fd has been removed + if (sockerrno == WSAENOTSOCK) + continue; // prepare again as the fd has been removed #endif - if (ret < 0) throw std::runtime_error("poll failed, errno=" + std::to_string(sockerrno)); + } process(pfds); }