From 0b6cf6e8e482f6c5861f3e4cb67557652d1caacb Mon Sep 17 00:00:00 2001 From: des Date: Thu, 20 Mar 2008 09:55:27 +0000 Subject: s/wait/delta/ to avoid namespace collision. MFC after: 2 weeks --- lib/libfetch/common.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'lib/libfetch/common.c') diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c index 13ebf64..e8eebcb 100644 --- a/lib/libfetch/common.c +++ b/lib/libfetch/common.c @@ -377,7 +377,7 @@ fetch_ssl(conn_t *conn, int verbose) ssize_t fetch_read(conn_t *conn, char *buf, size_t len) { - struct timeval now, timeout, wait; + struct timeval now, timeout, delta; fd_set readfds; ssize_t rlen, total; int r; @@ -393,19 +393,19 @@ fetch_read(conn_t *conn, char *buf, size_t len) while (fetchTimeout && !FD_ISSET(conn->sd, &readfds)) { FD_SET(conn->sd, &readfds); gettimeofday(&now, NULL); - wait.tv_sec = timeout.tv_sec - now.tv_sec; - wait.tv_usec = timeout.tv_usec - now.tv_usec; - if (wait.tv_usec < 0) { - wait.tv_usec += 1000000; - wait.tv_sec--; + delta.tv_sec = timeout.tv_sec - now.tv_sec; + delta.tv_usec = timeout.tv_usec - now.tv_usec; + if (delta.tv_usec < 0) { + delta.tv_usec += 1000000; + delta.tv_sec--; } - if (wait.tv_sec < 0) { + if (delta.tv_sec < 0) { errno = ETIMEDOUT; fetch_syserr(); return (-1); } errno = 0; - r = select(conn->sd + 1, &readfds, NULL, NULL, &wait); + r = select(conn->sd + 1, &readfds, NULL, NULL, &delta); if (r == -1) { if (errno == EINTR && fetchRestartCalls) continue; @@ -503,7 +503,7 @@ fetch_write(conn_t *conn, const char *buf, size_t len) ssize_t fetch_writev(conn_t *conn, struct iovec *iov, int iovcnt) { - struct timeval now, timeout, wait; + struct timeval now, timeout, delta; fd_set writefds; ssize_t wlen, total; int r; @@ -519,19 +519,19 @@ fetch_writev(conn_t *conn, struct iovec *iov, int iovcnt) while (fetchTimeout && !FD_ISSET(conn->sd, &writefds)) { FD_SET(conn->sd, &writefds); gettimeofday(&now, NULL); - wait.tv_sec = timeout.tv_sec - now.tv_sec; - wait.tv_usec = timeout.tv_usec - now.tv_usec; - if (wait.tv_usec < 0) { - wait.tv_usec += 1000000; - wait.tv_sec--; + delta.tv_sec = timeout.tv_sec - now.tv_sec; + delta.tv_usec = timeout.tv_usec - now.tv_usec; + if (delta.tv_usec < 0) { + delta.tv_usec += 1000000; + delta.tv_sec--; } - if (wait.tv_sec < 0) { + if (delta.tv_sec < 0) { errno = ETIMEDOUT; fetch_syserr(); return (-1); } errno = 0; - r = select(conn->sd + 1, NULL, &writefds, NULL, &wait); + r = select(conn->sd + 1, NULL, &writefds, NULL, &delta); if (r == -1) { if (errno == EINTR && fetchRestartCalls) continue; -- cgit v1.1