2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 22:35:15 +00:00

windows, python: Fix event type returned from poller

The function poll from poller should return a list of tuples
containing the events and their types.

On Windows the event type is not returned at the moment.
Instead of returning zero all the time, we check to see
the type of event and we set it accordingly before returning
the list.

This is used only for debugging purposes inside the function
"__log_wakeup" later on.

Signed-off-by: Alin Balutoiu <abalutoiu@cloudbasesolutions.com>
Acked-by: Russell Bryant <russell@ovn.org>
Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
This commit is contained in:
Alin Balutoiu
2017-08-22 10:47:21 +00:00
committed by Alin Gabriel Serdean
parent f6fabcc624
commit e2e31d17f8

View File

@@ -112,7 +112,14 @@ class _SelectSelect(object):
if retval == winutils.winerror.WAIT_TIMEOUT:
return []
return [(events[retval], 0)]
if events[retval] in self.rlist:
revent = POLLIN
elif events[retval] in self.wlist:
revent = POLLOUT
else:
revent = POLLERR
return [(events[retval], revent)]
else:
if timeout == -1:
# epoll uses -1 for infinite timeout, select uses None.