Commit 88681ffc authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Make sure to zero readfds if select returns with EINTR.

parent 294b911f
......@@ -409,10 +409,14 @@ main(int argc, char **argv)
FD_SET(kernel_socket, &readfds);
rc = select(MAX(protocol_socket, kernel_socket) + 1,
&readfds, NULL, NULL, &tv);
if(rc < 0 && errno != EINTR) {
perror("select");
sleep(1);
continue;
if(rc < 0) {
if(errno != EINTR) {
perror("select");
sleep(1);
continue;
} else {
FD_ZERO(&readfds);
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment