+2002-05-06 Jeffrey Stedfast <fejj@ximian.com>
+
+ * camel-tcp-stream-raw.c (socket_connect): Don't bother with
+ counting down the timeout.
+
2002-05-02 Jeffrey Stedfast <fejj@ximian.com>
* camel-stream-fs.c (stream_read): Same fix as the tcp stream.
#include <fcntl.h>
#include <errno.h>
#include <string.h>
-#include <time.h>
#include "camel-tcp-stream-raw.h"
#include "camel-operation.h"
} else {
int flags, fdmax, status;
fd_set rdset, wrset;
- time_t timeout, now;
flags = fcntl (fd, F_GETFL);
fcntl (fd, F_SETFL, flags | O_NONBLOCK);
return -1;
}
- now = time (NULL);
- timeout = now + 60 * 4;
do {
FD_ZERO (&rdset);
FD_ZERO (&wrset);
FD_SET (fd, &wrset);
FD_SET (cancel_fd, &rdset);
fdmax = MAX (fd, cancel_fd) + 1;
- tv.tv_sec = timeout - now;
+ tv.tv_sec = 60 * 4;
tv.tv_usec = 0;
status = select (fdmax, &rdset, &wrset, 0, &tv);
- now = time (NULL);
- } while (now < timeout && status == -1 && errno == EINTR);
+ } while (status == -1 && errno == EINTR);
if (status <= 0) {
close (fd);