summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2014-01-31 11:12:53 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2014-01-31 11:12:53 (GMT)
commitdcd9740ad2932f4049e912d8721933696373fe4c (patch)
tree2827fc31b7e57e7bac925f338303c8acf33a1011 /Modules
parent31f65044a977307915412edffddcb4962a8928a3 (diff)
downloadcpython-dcd9740ad2932f4049e912d8721933696373fe4c.zip
cpython-dcd9740ad2932f4049e912d8721933696373fe4c.tar.gz
cpython-dcd9740ad2932f4049e912d8721933696373fe4c.tar.bz2
Issue #20452: select and selectors round (again) timeout away from zero for
poll and epoll Improve also debug info to analyze the issue
Diffstat (limited to 'Modules')
-rw-r--r--Modules/selectmodule.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index d44e8de..0c9b9d9 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -1458,7 +1458,9 @@ pyepoll_poll(pyEpoll_Object *self, PyObject *args, PyObject *kwds)
return NULL;
}
else {
- timeout = (int)(dtimeout * 1000.0);
+ /* epoll_wait() has a resolution of 1 millisecond, round away from zero
+ to wait *at least* dtimeout seconds. */
+ timeout = (int)ceil(dtimeout * 1000.0);
}
if (maxevents == -1) {