Browse Source

sigh

master
Marc Alexander Lehmann 10 years ago
parent
commit
0af42bdc3e
2 changed files with 4 additions and 4 deletions
  1. +3
    -3
      ev.c
  2. +1
    -1
      ev_kqueue.c

+ 3
- 3
ev.c View File

@ -472,7 +472,7 @@ struct signalfd_siginfo
#define MAX_BLOCKTIME 59.743 /* never wait longer than this time (to detect time jumps) */
#define EV_TV_SET(tv,t) do { tv.tv_sec = (long)t; tv.tv_usec = (long)((t - tv.tv_sec) * 1e6); } while (0)
#define EV_TS_SET(ts,t) do { ts.tv_sec = (long)t; tv.tv_nsec = (long)((t - tv.tv_sec) * 1e9); } while (0)
#define EV_TS_SET(ts,t) do { ts.tv_sec = (long)t; ts.tv_nsec = (long)((t - ts.tv_sec) * 1e9); } while (0)
#if __GNUC__ >= 4
# define expect(expr,value) __builtin_expect ((expr),(value))
@ -773,7 +773,7 @@ ev_sleep (ev_tstamp delay)
#if EV_USE_NANOSLEEP
struct timespec ts;
EV_SET_TS (ts, delay);
EV_TS_SET (ts, delay);
nanosleep (&ts, 0);
#elif defined(_WIN32)
Sleep ((unsigned long)(delay * 1e3));
@ -783,7 +783,7 @@ ev_sleep (ev_tstamp delay)
/* here we rely on sys/time.h + sys/types.h + unistd.h providing select */
/* something not guaranteed by newer posix versions, but guaranteed */
/* by older ones */
EV_SET_TV (tv, delay);
EV_TS_SET (tv, delay);
select (0, 0, 0, 0, &tv);
#endif
}


+ 1
- 1
ev_kqueue.c View File

@ -97,7 +97,7 @@ kqueue_poll (EV_P_ ev_tstamp timeout)
}
EV_RELEASE_CB;
EV_SET_TV (tv, timeout);
EV_TS_SET (ts, timeout);
res = kevent (backend_fd, kqueue_changes, kqueue_changecnt, kqueue_events, kqueue_eventmax, &ts);
EV_ACQUIRE_CB;
kqueue_changecnt = 0;


Loading…
Cancel
Save