Skip to content
Snippets Groups Projects
Commit db2b48d2 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

dhtrunner: select on maxfd+1

parent 2b938110
Branches
Tags
No related merge requests found
......@@ -569,7 +569,8 @@ DhtRunner::startNetwork(const SockAddr sin4, const SockAddr sin6)
if(s6 >= 0)
FD_SET(s6, &readfds);
int rc = select(s4 > s6 ? s4 + 1 : s6 + 1, &readfds, nullptr, nullptr, nullptr);
int selectFd = std::max({s4, s6, stop_readfd}) + 1;
int rc = select(selectFd, &readfds, nullptr, nullptr, nullptr);
if(rc < 0) {
if(errno != EINTR) {
perror("select");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment