Commit 593bf33f authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Make sure we don't recv when select returns 0.

parent 9450e4d3
......@@ -385,9 +385,9 @@ main(int argc, char **argv)
timeval_min_sec(&tv, nets[i].update_time + update_interval);
}
timeval_min(&tv, &update_flush_time);
FD_ZERO(&readfds);
if(timeval_compare(&tv, &now) > 0) {
timeval_minus(&tv, &tv, &now);
FD_ZERO(&readfds);
FD_SET(protocol_socket, &readfds);
rc = select(protocol_socket + 1, &readfds, NULL, NULL, &tv);
if(rc < 0 && errno != EINTR) {
......
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