]> git.puffer.fish Git - mirror/frr.git/commit
lib: Fix some poll semantics
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 19 May 2016 13:56:35 +0000 (09:56 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 10 Jun 2016 15:18:58 +0000 (11:18 -0400)
commit1bba4c938bf1139a667b913ea3fbe14be0bd7099
treeb5b8831105d3ccb6da3d85c52bb22382b09ed6af
parent56f70e170dd49aa10e08d44cf200753baa7a4548
lib: Fix some poll semantics

Two Fixes:

1) When a fd has both read and write as a .events.
(POLLHUP | POLLIN | POLLOUT) and a
thread_cancel_read_write call is executed
from a protocol, the code was blindly removing
the fd from consideration at all.

2) POLLNVAL was being evaluated before POLLIN|POLLOUT
were being evaluated.  While I didn't see a case
of POLLNVAL being included with other .revent flags
I decided to move the POLLNVAL and POLLHUP handling
to the same section of code.

Additionally the function thread_cancel_read_write
was poorly named and let me to poorly implement
the poll version of it.  I've renamed the function
thread_cancel_read_or_write in an attempt to
make this problem moot in the future.

Ticket: CM-11027
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
(cherry picked from commit f6da66a913bcae1d3f75c55f24e72e97288af619)
lib/thread.c