diff options
author | Niels Provos <provos@gmail.com> | 2007-07-30 22:41:00 +0000 |
---|---|---|
committer | Niels Provos <provos@gmail.com> | 2007-07-30 22:41:00 +0000 |
commit | 3ad6b47e03993f688e92fb202c89e3be984a8f56 (patch) | |
tree | 94203af743c25a5726325989ecb2b2f18619595c /poll.c | |
parent | d7918e7963db292b49d575fbd3b9c47f4d59c9cf (diff) | |
download | libevent-3ad6b47e03993f688e92fb202c89e3be984a8f56.tar.gz |
make clock_monotonic work; do not use default timeout;
from Scott Lamb, plus some fixes from me.
svn:r371
Diffstat (limited to 'poll.c')
-rw-r--r-- | poll.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -148,13 +148,16 @@ poll_check_ok(struct pollop *pop) int poll_dispatch(struct event_base *base, void *arg, struct timeval *tv) { - int res, i, sec, nfds; + int res, i, msec = -1, nfds; struct pollop *pop = arg; poll_check_ok(pop); - sec = tv->tv_sec * 1000 + (tv->tv_usec + 999) / 1000; + + if (tv != NULL) + msec = tv->tv_sec * 1000 + (tv->tv_usec + 999) / 1000; + nfds = pop->nfds; - res = poll(pop->event_set, nfds, sec); + res = poll(pop->event_set, nfds, msec); if (res == -1) { if (errno != EINTR) { |