Commit ea0a8be2 authored by Jan Moskyto Matejka's avatar Jan Moskyto Matejka
Browse files

IO/Poll: fix mistaken variable merge

The events variable is used in the short loop decision. The reasons are
not much clear, keeping this to keep the former behaviour.
parent 54bb032d
...@@ -2045,7 +2045,7 @@ io_loop(void) ...@@ -2045,7 +2045,7 @@ io_loop(void)
{ {
int poll_tout; int poll_tout;
time_t tout; time_t tout;
int nfds, events; int nfds, events, pout;
sock *s; sock *s;
node *n; node *n;
int fdmax = 256; int fdmax = 256;
...@@ -2125,16 +2125,16 @@ io_loop(void) ...@@ -2125,16 +2125,16 @@ io_loop(void)
/* And finally enter poll() to find active sockets */ /* And finally enter poll() to find active sockets */
watchdog_stop(); watchdog_stop();
events = poll(pfd, nfds, poll_tout); pout = poll(pfd, nfds, poll_tout);
watchdog_start(); watchdog_start();
if (events < 0) if (pout < 0)
{ {
if (errno == EINTR || errno == EAGAIN) if (errno == EINTR || errno == EAGAIN)
continue; continue;
die("poll: %m"); die("poll: %m");
} }
if (events) if (pout)
{ {
/* guaranteed to be non-empty */ /* guaranteed to be non-empty */
current_sock = SKIP_BACK(sock, n, HEAD(sock_list)); current_sock = SKIP_BACK(sock, n, HEAD(sock_list));
......
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