From c29141f10bba7024fb2630b3e4c7f658bbf472be Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Mon, 14 Feb 2005 09:43:36 +0000 Subject: r5393: trigger timed events not to early, better do it a bit to late metze (This used to be commit 67bf637e9a44202061fd71c92142f835ba76da89) --- source4/lib/events/events_standard.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- cgit