[BUG] ev_kqueue was forgotten during the switch to timeval

This commit is contained in:
Willy Tarreau 2007-05-14 03:15:46 +02:00
parent 544eb40f29
commit 79b8a62ff6

View File

@ -98,16 +98,23 @@ REGPRM1 static void __fd_clo(int fd)
/* /*
* kqueue() poller * kqueue() poller
*/ */
REGPRM2 static void _do_poll(struct poller *p, int wait_time) REGPRM2 static void _do_poll(struct poller *p, struct timeval *exp)
{ {
int status; int status;
int count, fd; int count, fd;
struct timespec timeout, *to_ptr; struct timespec timeout, *to_ptr;
to_ptr = NULL; // no timeout to_ptr = NULL; // no timeout
if (wait_time >= 0) { if (tv_isset(exp)) {
timeout.tv_sec = wait_time / 1000; struct timeval delta;
timeout.tv_nsec = (wait_time % 1000) * 1000000;
if (tv_isge(&now, exp))
delta.tv_sec = delta.tv_usec = 0;
else
tv_remain(&now, exp, &delta);
timeout.tv_sec = delta.tv_sec;
timeout.tv_nsec = delta.tv_usec * 1000;
to_ptr = &timeout; to_ptr = &timeout;
} }