… | |
… | |
61 | int dummy; |
61 | int dummy; |
62 | }; |
62 | }; |
63 | |
63 | |
64 | static struct event_base *ev_x_cur; |
64 | static struct event_base *ev_x_cur; |
65 | |
65 | |
66 | static void |
|
|
67 | ev_tv_set (struct timeval *tv, ev_tstamp at) |
|
|
68 | { |
|
|
69 | tv->tv_sec = (long)at; |
|
|
70 | tv->tv_usec = (long)((at - (ev_tstamp)tv->tv_sec) * 1e6); |
|
|
71 | } |
|
|
72 | |
|
|
73 | static ev_tstamp |
66 | static ev_tstamp |
74 | ev_tv_get (struct timeval *tv) |
67 | ev_tv_get (struct timeval *tv) |
75 | { |
68 | { |
76 | if (tv) |
69 | if (tv) |
77 | { |
70 | { |
… | |
… | |
303 | if (ev->ev_events & EV_TIMEOUT || ev_is_active (&ev->to) || ev_is_pending (&ev->to)) |
296 | if (ev->ev_events & EV_TIMEOUT || ev_is_active (&ev->to) || ev_is_pending (&ev->to)) |
304 | { |
297 | { |
305 | revents |= EV_TIMEOUT; |
298 | revents |= EV_TIMEOUT; |
306 | |
299 | |
307 | if (tv) |
300 | if (tv) |
308 | ev_tv_set (tv, ev_now (EV_A)); /* not sure if this is right :) */ |
301 | EV_TV_SET (tv, ev_now (EV_A)); /* not sure if this is right :) */ |
309 | } |
302 | } |
310 | |
303 | |
311 | return events & revents; |
304 | return events & revents; |
312 | } |
305 | } |
313 | |
306 | |