poll: handle POLLNVAL

This commit is contained in:
Benjamin Sergeant 2020-01-09 13:45:58 -08:00
parent 21f42210a2
commit b75264b98f

View File

@ -63,6 +63,8 @@ namespace ix
fds[0].fd = sockfd; fds[0].fd = sockfd;
fds[0].events = (readyToRead) ? POLLIN : POLLOUT; fds[0].events = (readyToRead) ? POLLIN : POLLOUT;
// this is ignored by poll, but our select based poll wrapper on Windows needs it
fds[0].events |= POLLERR; fds[0].events |= POLLERR;
// File descriptor used to interrupt select when needed // File descriptor used to interrupt select when needed
@ -133,7 +135,8 @@ namespace ix
} }
#endif #endif
} }
else if (sockfd != -1 && (fds[0].revents & POLLERR || fds[0].revents & POLLHUP)) else if (sockfd != -1 && (fds[0].revents & POLLERR || fds[0].revents & POLLHUP ||
fds[0].revents & POLLNVAL))
{ {
pollResult = PollResultType::Error; pollResult = PollResultType::Error;
} }