From 6b67f0aee601e74767c0c337bcf39df8210d3092 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 16 May 2003 20:14:54 +0300 Subject: [PATCH] If there were no timeouts, struct timeval wasn't initialized and select() might have failed because of it. Patch by Mark E. Mallett. --HG-- branch : HEAD --- src/lib/ioloop.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/ioloop.c b/src/lib/ioloop.c index f17c875e69..e7bb9641da 100644 --- a/src/lib/ioloop.c +++ b/src/lib/ioloop.c @@ -223,8 +223,12 @@ void timeout_destroy(struct ioloop *ioloop, struct timeout *timeout) int io_loop_get_wait_time(struct timeout *timeout, struct timeval *tv, struct timeval *tv_now) { - if (timeout == NULL) + if (timeout == NULL) { + /* no timeouts. give it INT_MAX msecs. */ + tv->tv_sec = INT_MAX / 1000; + tv->tv_usec = 0; return INT_MAX; + } if (tv_now == NULL) { if (gettimeofday(tv, NULL) < 0) -- 2.47.3