]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: Really fix handling of poll
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 28 Mar 2016 12:07:08 +0000 (08:07 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 28 Mar 2016 12:07:08 +0000 (08:07 -0400)
This fix is just the actual point fix of the poll event handling.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
lib/thread.c

index b1d2d919032bc57d23b7e7e6bb465290108b8c5d..c56a9ec5054e417a63eca07274ec997f9fcaafee 100644 (file)
@@ -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;