Skip to content

Commit

Permalink
poll-loop: Fix assertion in poll_create_node().
Browse files Browse the repository at this point in the history
Zero is a valid value for a file descriptor.

Reported-by: Nikita Kalyazin <[email protected]>
Signed-off-by: Ilya Maximets <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
igsilya authored and blp committed Sep 22, 2015
1 parent 1fb35cc commit ff14da3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ Hao Zheng [email protected]
Helmut Schaa [email protected]
Huanle Han [email protected]
Ian Campbell [email protected]
Ilya Maximets [email protected]
Isaku Yamahata [email protected]
James P. [email protected]
James Page [email protected]
Expand Down Expand Up @@ -315,6 +316,7 @@ Mikael Doverhag [email protected]
Mrinmoy Das [email protected]
Nagi Reddy Jonnala [email protected]
Niels van Adrichem [email protected]
Nikita Kalyazin [email protected]
Niklas Andersson [email protected]
Pankaj Thakkar [email protected]
Pasi Kärkkäinen [email protected]
Expand Down
4 changes: 2 additions & 2 deletions lib/poll-loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ poll_create_node(int fd, HANDLE wevent, short int events, const char *where)
COVERAGE_INC(poll_create_node);

/* Both 'fd' and 'wevent' cannot be set. */
ovs_assert(!fd != !wevent);
ovs_assert(fd == -1 || !wevent);

/* Check for duplicate. If found, "or" the events. */
node = find_poll_node(loop, fd, wevent);
Expand Down Expand Up @@ -159,7 +159,7 @@ poll_fd_wait_at(int fd, short int events, const char *where)
void
poll_wevent_wait_at(HANDLE wevent, const char *where)
{
poll_create_node(0, wevent, 0, where);
poll_create_node(-1, wevent, 0, where);
}
#endif /* _WIN32 */

Expand Down

0 comments on commit ff14da3

Please sign in to comment.