Skip to content

Commit

Permalink
fixed epoll-based iomux_run() implementation to accept a null timeout…
Browse files Browse the repository at this point in the history
… argument

which needs to be translated to -1 in terms of epoll waiting time
  • Loading branch information
xant committed Jan 5, 2014
1 parent ab0e6cd commit 1139f3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/iomux.c
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ iomux_run(iomux_t *iomux, struct timeval *tv_default)

struct timeval *tv = tv_default;

int epoll_waiting_time = (tv->tv_sec * 1000) + (tv->tv_usec / 1000);
int epoll_waiting_time = tv ? ((tv->tv_sec * 1000) + (tv->tv_usec / 1000)) : -1;
int num_fds = iomux->maxfd - iomux->minfd + 1;
int n = epoll_wait(iomux->efd, iomux->events, num_fds, epoll_waiting_time);
int i;
Expand Down

0 comments on commit 1139f3d

Please sign in to comment.