Permalink
Browse files

Merge pull request #8 from Cofyc/kqueue

Kqueue
  • Loading branch information...
2 parents 163c04c + ba39efb commit d9d0d593d3caa96ed6acb869763d422ea3fd83ba @cloudwu committed Nov 29, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 mread.c
View
4 mread.c
@@ -235,8 +235,8 @@ _read_queue(struct mread_pool * self, int timeout) {
int n = epoll_wait(self->epoll_fd , self->ev, READQUEUE, timeout);
#elif HAVE_KQUEUE
struct timespec timeoutspec;
- timeoutspec.tv_sec = timeout;
- timeoutspec.tv_nsec = 0;
+ timeoutspec.tv_sec = timeout / 1000;
+ timeoutspec.tv_nsec = (timeout % 1000) * 1000000;
int n = kevent(self->kqueue_fd, NULL, 0, self->ev, READQUEUE, &timeoutspec);
#endif
if (n == -1) {

0 comments on commit d9d0d59

Please sign in to comment.