Skip to content

Commit 1e0c407

Browse files
committed
sock: align exception monitoring between poll() and select() backends
1 parent df0dc1e commit 1e0c407

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎src/util/sock.cpp‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,14 @@ bool Sock::WaitMany(std::chrono::milliseconds timeout, EventsPerSock& events_per
216216
const auto& s = sock->m_socket;
217217
if (events.requested & RecvEvent) {
218218
FD_SET(s, &recv);
219+
FD_SET(s, &err);
219220
}
220221
if (events.requested & SendEvent) {
221222
FD_SET(s, &send);
222223
}
223-
FD_SET(s, &err);
224-
socket_max = std::max(socket_max, s);
224+
if (events.requested & (RecvEvent | SendEvent)) {
225+
socket_max = std::max(socket_max, s);
226+
}
225227
}
226228

227229
timeval tv = MillisToTimeval(timeout);

0 commit comments

Comments
 (0)