diff options
| author | Richard Nyberg <rnyberg@murmeldjur.se> | 2007-02-25 17:34:12 +0000 |
|---|---|---|
| committer | Richard Nyberg <rnyberg@murmeldjur.se> | 2007-02-25 17:34:12 +0000 |
| commit | 91f85c222be7ef247c8f2e18815eb23c336ed081 (patch) | |
| tree | e622ff381949cdbda284550f1fb701e29b0eba76 /libevent/event.c | |
| parent | 372cec7b53ce0959ba5756e1e51f1f15793a3663 (diff) | |
| download | btpd-91f85c222be7ef247c8f2e18815eb23c336ed081.tar.gz btpd-91f85c222be7ef247c8f2e18815eb23c336ed081.zip | |
Update to libevent from patches-1.3 r335.
Diffstat (limited to 'libevent/event.c')
| -rw-r--r-- | libevent/event.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libevent/event.c b/libevent/event.c index b5bda5c..f6d2b1c 100644 --- a/libevent/event.c +++ b/libevent/event.c @@ -149,8 +149,12 @@ gettime(struct timeval *tp) { #ifdef HAVE_CLOCK_GETTIME struct timespec ts; - + +#ifdef HAVE_CLOCK_MONOTONIC if (clock_gettime(CLOCK_MONOTONIC, &ts) == -1) +#else + if (clock_gettime(CLOCK_REALTIME, &ts) == -1) +#endif return (-1); tp->tv_sec = ts.tv_sec; tp->tv_usec = ts.tv_nsec / 1000; @@ -297,6 +301,8 @@ event_process_active(struct event_base *base) } } + assert(activeq != NULL); + for (ev = TAILQ_FIRST(activeq); ev; ev = TAILQ_FIRST(activeq)) { event_queue_remove(base, ev, EVLIST_ACTIVE); @@ -307,6 +313,8 @@ event_process_active(struct event_base *base) ncalls--; ev->ev_ncalls = ncalls; (*ev->ev_callback)((int)ev->ev_fd, ev->ev_res, ev->ev_arg); + if (event_gotsig) + return; } } } |