From c895db0641052d49ab3c3854a03197cdef2aa108 Mon Sep 17 00:00:00 2001 From: Nicolas Pope <nicolas.pope@utu.fi> Date: Mon, 9 May 2022 09:06:27 +0100 Subject: [PATCH] Attempt WSAPoll invalid arg fix --- src/universe.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/universe.cpp b/src/universe.cpp index f6f1bdf..e0d4feb 100644 --- a/src/universe.cpp +++ b/src/universe.cpp @@ -299,8 +299,13 @@ socket_t Universe::_setDescriptors() { auto sock = l->fd(); if (sock != INVALID_SOCKET) { pollfd fdentry; + #ifdef WIN32 + fdentry.events = POLLIN; + #else fdentry.events = POLLIN | POLLERR; + #endif fdentry.fd = sock; + fdentry.revents = 0; impl_->pollfds.push_back(fdentry); impl_->idMap[sock] = impl_->pollfds.size() - 1; @@ -318,8 +323,13 @@ socket_t Universe::_setDescriptors() { n = std::max<socket_t>(n, sock); if (sock != INVALID_SOCKET) { pollfd fdentry; + #ifdef WIN32 + fdentry.events = POLLIN; + #else fdentry.events = POLLIN | POLLERR; + #endif fdentry.fd = sock; + fdentry.revents = 0; impl_->pollfds.push_back(fdentry); impl_->idMap[sock] = impl_->pollfds.size() - 1; -- GitLab