Do we additionally need this?

diff --git a/lib/poll-loop.c b/lib/poll-loop.c
index 36eb5ac..28e98ad 100644
--- a/lib/poll-loop.c
+++ b/lib/poll-loop.c
@@ -297,7 +297,7 @@ free_poll_nodes(struct poll_loop *loop)
     HMAP_FOR_EACH_SAFE (node, next, hmap_node, &loop->poll_nodes) {
         hmap_remove(&loop->poll_nodes, &node->hmap_node);
 #ifdef _WIN32
-        if (node->wevent && node->pollfd.fd) {
+        if (node->wevent && node->pollfd.fd >= 0) {
             WSAEventSelect(node->pollfd.fd, NULL, 0);
             CloseHandle(node->wevent);
         }
@@ -341,7 +341,7 @@ poll_block(void)
         pollfds[i] = node->pollfd;
 #ifdef _WIN32
         wevents[i] = node->wevent;
-        if (node->pollfd.fd && node->wevent) {
+        if (node->pollfd.fd >= 0 && node->wevent) {
             short int wsa_events = 0;
             if (node->pollfd.events & POLLIN) {
                 wsa_events |= FD_READ | FD_ACCEPT | FD_CLOSE;


On Tue, Sep 29, 2015 at 02:39:32PM -0700, Gurucharan Shetty wrote:
> Windows even handling selector functions is such that it does not like
> when fd is -1 (I have not root-caused the exact reason). This commit
> causes most of the unit tests on Windows to fail. So the larger
> question is, even though fd of zero is valid, do we really pass it to
> any of our poll node functions?
> 
> On Tue, Sep 22, 2015 at 9:34 AM, Ben Pfaff <[email protected]> wrote:
> > Thanks, I understand now.  I applied this to master, changing Nikita's
> > Signed-off-by: to a Reported-by:.
> >
> > On Tue, Sep 22, 2015 at 07:30:47PM +0300, Ilya Maximets wrote:
> >> Author is me, Nikita found and analyzed the problem.
> >> You may change Signed-off-by to something more proper.
> >>
> >> Best regards, Ilya Maximets.
> >>
> >> On 22.09.2015 18:49, Ben Pfaff wrote:
> >> > On Tue, Sep 22, 2015 at 12:27:15PM +0300, Ilya Maximets wrote:
> >> >> Zero is a valid value for a file descriptor.
> >> >>
> >> >> Signed-off-by: Ilya Maximets <[email protected]>
> >> >> Signed-off-by: Nikita Kalyazin <[email protected]>
> >> >
> >> > Thanks for the patch!
> >> >
> >> > The sign-off chain is unclear.  Who is the author?  What did the other
> >> > person do?
> >> >
> >> > Thanks,
> >> >
> >> > Ben.
> >> >
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to