diff options
Diffstat (limited to 'Modules/selectmodule.c')
-rw-r--r-- | Modules/selectmodule.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c index c492224..ab2016a 100644 --- a/Modules/selectmodule.c +++ b/Modules/selectmodule.c @@ -1379,7 +1379,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) { |