]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
If there were no timeouts, struct timeval wasn't initialized and select()
authorTimo Sirainen <tss@iki.fi>
Fri, 16 May 2003 17:14:54 +0000 (20:14 +0300)
committerTimo Sirainen <tss@iki.fi>
Fri, 16 May 2003 17:14:54 +0000 (20:14 +0300)
might have failed because of it. Patch by Mark E. Mallett.

--HG--
branch : HEAD

src/lib/ioloop.c

index f17c875e691db72e4e9fdcb5a9ffed4f7d83f990..e7bb9641da83508eb62574c15c16f32d3466cc3b 100644 (file)
@@ -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)