]> 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, 20 May 2016 18:32:00 +0000 (14:32 -0400)
commitf6da66a913bcae1d3f75c55f24e72e97288af619
tree26d8e6ba1709108dda32331619f536c6d052eef6
parent35b80046b4e1ab0462da32810d2b79734beb1938
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>
lib/thread.c