Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/socket_poller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,7 @@ int zmq::socket_poller_t::wait (zmq::socket_poller_t::event_t *events_,
if (rc == -1 && errno == EINTR) {
return -1;
}

errno_assert (rc >= 0);

// Receive the signal from pollfd
Expand Down
20 changes: 19 additions & 1 deletion src/windows.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#endif
#endif

#include "err.hpp"
#include <winsock2.h>
#include <windows.h>
#include <mswsock.h>
Expand Down Expand Up @@ -57,7 +58,24 @@ struct tcp_keepalive
#if defined ZMQ_IOTHREAD_POLLER_USE_POLL || defined ZMQ_POLL_BASED_ON_POLL
static inline int poll (struct pollfd *pfd, unsigned long nfds, int timeout)
{
return WSAPoll (pfd, nfds, timeout);
int rc = WSAPoll (pfd, nfds, timeout);
if (rc == -1) {
int wsaError = WSAGetLastError ();
switch (wsaError) {
// let these conditions appear as an interrupted call to
// simplify downstream error processing.
case WSAENETDOWN:
case WSAENOBUFS:
errno = EINTR;
break;

default:
errno = zmq::wsa_error_to_errno (wsaError);
break;
}
}

return rc;
}
#endif

Expand Down
Loading