[dovecot-cvs] dovecot/src/lib ioloop.c,1.15,1.16
cras at procontrol.fi
cras at procontrol.fi
Fri May 16 21:14:56 EEST 2003
Update of /home/cvs/dovecot/src/lib
In directory danu:/tmp/cvs-serv23484/lib
Modified Files:
ioloop.c
Log Message:
If there were no timeouts, struct timeval wasn't initialized and select()
might have failed because of it. Patch by Mark E. Mallett.
Index: ioloop.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/ioloop.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- ioloop.c 10 Apr 2003 22:37:25 -0000 1.15
+++ ioloop.c 16 May 2003 17:14:54 -0000 1.16
@@ -223,8 +223,12 @@
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)
More information about the dovecot-cvs
mailing list