summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/events/events_standard.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source4/lib/events/events_standard.c b/source4/lib/events/events_standard.c
index 9783603759..77797eec64 100644
--- a/source4/lib/events/events_standard.c
+++ b/source4/lib/events/events_standard.c
@@ -380,7 +380,8 @@ static int event_loop_epoll(struct event_context *ev, struct timeval *tvalp)
int timeout = -1;
if (tvalp) {
- timeout = (tvalp->tv_usec / 1000) + (tvalp->tv_sec*1000);
+ /* it's better to trigger timed events a bit later than to early */
+ timeout = ((tvalp->tv_usec+999) / 1000) + (tvalp->tv_sec*1000);
}
ret = epoll_wait(ev->epoll_fd, events, maxevents, timeout);