From 95c40c335e5baa504b3a57c2f8441abd15c65a47 Mon Sep 17 00:00:00 2001 From: Jan Moskyto Matejka Date: Wed, 30 Mar 2016 16:21:32 +0200 Subject: [PATCH] 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. --- sysdep/unix/io.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c index eae8885f..13b30240 100644 --- a/sysdep/unix/io.c +++ b/sysdep/unix/io.c @@ -2040,7 +2040,7 @@ io_loop(void) { int poll_tout; time_t tout; - int nfds, events; + int nfds, events, pout; sock *s; node *n; int fdmax = 256; @@ -2120,16 +2120,16 @@ io_loop(void) /* And finally enter poll() to find active sockets */ watchdog_stop(); - events = poll(pfd, nfds, poll_tout); + pout = poll(pfd, nfds, poll_tout); watchdog_start(); - if (events < 0) + if (pout < 0) { if (errno == EINTR || errno == EAGAIN) continue; die("poll: %m"); } - if (events) + if (pout) { /* guaranteed to be non-empty */ current_sock = SKIP_BACK(sock, n, HEAD(sock_list));