From 3ba5507ba7793f6a6ecc6fbaaa3f580eede963f5 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Mon, 6 May 2002 18:59:01 +0000 Subject: Don't bother with counting down the timeout. 2002-05-06 Jeffrey Stedfast * camel-tcp-stream-raw.c (socket_connect): Don't bother with counting down the timeout. svn path=/trunk/; revision=16690 --- camel/camel-tcp-stream-raw.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'camel/camel-tcp-stream-raw.c') diff --git a/camel/camel-tcp-stream-raw.c b/camel/camel-tcp-stream-raw.c index 5f5f1b8bf6..8b6a868b47 100644 --- a/camel/camel-tcp-stream-raw.c +++ b/camel/camel-tcp-stream-raw.c @@ -32,7 +32,6 @@ #include #include #include -#include #include "camel-tcp-stream-raw.h" #include "camel-operation.h" @@ -413,7 +412,6 @@ socket_connect (struct hostent *h, int port) } 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); @@ -429,20 +427,17 @@ socket_connect (struct hostent *h, int port) 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); -- cgit v1.2.3