From 1139f3d5ab2104fa655855a97411cea598bfb784 Mon Sep 17 00:00:00 2001 From: Andrea Guzzo Date: Sun, 5 Jan 2014 12:16:05 -0500 Subject: [PATCH] fixed epoll-based iomux_run() implementation to accept a null timeout argument which needs to be translated to -1 in terms of epoll waiting time --- src/iomux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/iomux.c b/src/iomux.c index 1c86acd..54268f5 100644 --- a/src/iomux.c +++ b/src/iomux.c @@ -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;