Pārlūkot izejas kodu

Merge pull request #1254 from paullouisageneau/fix-wsaenotsock

Prevent poll service failure with WSAENOTSOCK on Windows
Paul-Louis Ageneau 10 mēneši atpakaļ
vecāks
revīzija
bc016d68c4
1 mainītis faili ar 4 papildinājumiem un 3 dzēšanām
  1. 4 3
      src/impl/pollservice.cpp

+ 4 - 3
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);
 		}