From c026ca1c01f688d0f6b8754cd2c5d3388f4e2162 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 28 Mar 2016 08:07:08 -0400 Subject: [PATCH] lib: Really fix handling of poll This fix is just the actual point fix of the poll event handling. Signed-off-by: Donald Sharp --- lib/thread.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/thread.c b/lib/thread.c index b1d2d91903..c56a9ec505 100644 --- a/lib/thread.c +++ b/lib/thread.c @@ -1245,6 +1245,7 @@ check_pollfds(struct thread_master *m, fd_set *readfd, int num) if(m->handler.pfds[i].revents == 0) continue; + ready++; /* remove fd from list on POLLNVAL */ if (m->handler.pfds[i].revents & POLLNVAL) { @@ -1258,9 +1259,9 @@ check_pollfds(struct thread_master *m, fd_set *readfd, int num) /* POLLIN / POLLOUT process event */ if (m->handler.pfds[i].revents & POLLIN) - ready += thread_process_fds_helper(m, m->read[m->handler.pfds[i].fd], NULL, POLLIN, i); + thread_process_fds_helper(m, m->read[m->handler.pfds[i].fd], NULL, POLLIN, i); if (m->handler.pfds[i].revents & POLLOUT) - ready += thread_process_fds_helper(m, m->write[m->handler.pfds[i].fd], NULL, POLLOUT, i); + thread_process_fds_helper(m, m->write[m->handler.pfds[i].fd], NULL, POLLOUT, i); /* remove fd from list on POLLHUP after other event is processed */ if (m->handler.pfds[i].revents & POLLHUP) @@ -1270,7 +1271,6 @@ check_pollfds(struct thread_master *m, fd_set *readfd, int num) (m->handler.pfdsize-i-1) * sizeof(struct pollfd)); m->handler.pfdcount--; i--; - ready++; } else m->handler.pfds[i].revents = 0; -- 2.39.5