summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-02-14 09:43:36 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:09:50 -0500
commitc29141f10bba7024fb2630b3e4c7f658bbf472be (patch)
tree55456652e7d71c1ba464f80b0f78c963c0e17bbb
parent352de700cadbb2c4e5b5e9ddc375e9de847e2193 (diff)
downloadsamba-c29141f10bba7024fb2630b3e4c7f658bbf472be.tar.gz
samba-c29141f10bba7024fb2630b3e4c7f658bbf472be.tar.bz2
samba-c29141f10bba7024fb2630b3e4c7f658bbf472be.zip
r5393: trigger timed events not to early, better do it a bit to late
metze (This used to be commit 67bf637e9a44202061fd71c92142f835ba76da89)
-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);