summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2010-10-24 17:25:33 +0000
committerroot <root>2010-10-24 17:25:33 +0000
commit3d9d17fca7e78e09b61cfa2370d4fea2ac4b36b8 (patch)
tree06b4cda69d7ded2c835f21a5e7467470f1926f80
parentef2069bdee8f06a2187f1827d4623522ccb0d9ac (diff)
*** empty log message ***
-rw-r--r--event.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/event.c b/event.c
index d2e5078..cef2047 100644
--- a/event.c
+++ b/event.c
@@ -47,9 +47,6 @@
# include "event.h"
#endif
-/* same definition as in ev.c */
-#define EV_TV_SET(tv,t) do { tv.tv_sec = (long)t; tv.tv_usec = (long)((t - tv.tv_sec) * 1e6); } while (0)
-
#if EV_MULTIPLICITY
# define dLOOPev struct ev_loop *loop = (struct ev_loop *)ev->ev_base
# define dLOOPbase struct ev_loop *loop = (struct ev_loop *)base
@@ -301,7 +298,12 @@ int event_pending (struct event *ev, short events, struct timeval *tv)
revents |= EV_TIMEOUT;
if (tv)
- EV_TV_SET (tv, ev_now (EV_A)); /* not sure if this is right :) */
+ {
+ ev_tstamp at = ev_now (EV_A);
+
+ tv->tv_sec = (long)at;
+ tv->tv_usec = (long)((at - (ev_tstamp)tv->tv_sec) * 1e6);
+ }
}
return events & revents;