diff options
author | Alin Balutoiu <abalutoiu@cloudbasesolutions.com> | 2017-08-22 10:47:21 +0000 |
---|---|---|
committer | Alin Gabriel Serdean <aserdean@ovn.org> | 2017-08-23 18:19:49 +0300 |
commit | e2e31d17f88d14fdabb720cf895bc2b705c8ed9a (patch) | |
tree | 066724bc946c580994d3731d7b25b7f69bc761c1 /python | |
parent | f6fabcc62458d656046c9852ee80fcff3e516e6e (diff) | |
download | openvswitch-e2e31d17f88d14fdabb720cf895bc2b705c8ed9a.tar.gz |
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>
Diffstat (limited to 'python')
-rw-r--r-- | python/ovs/poller.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/python/ovs/poller.py b/python/ovs/poller.py index 809e51200..2f3fcf9b6 100644 --- a/python/ovs/poller.py +++ b/python/ovs/poller.py @@ -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. |