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) ...@@ -409,10 +409,14 @@ main(int argc, char **argv)
FD_SET(kernel_socket, &readfds); FD_SET(kernel_socket, &readfds);
rc = select(MAX(protocol_socket, kernel_socket) + 1, rc = select(MAX(protocol_socket, kernel_socket) + 1,
&readfds, NULL, NULL, &tv); &readfds, NULL, NULL, &tv);
if(rc < 0 && errno != EINTR) { if(rc < 0) {
perror("select"); if(errno != EINTR) {
sleep(1); perror("select");
continue; 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