summaryrefslogtreecommitdiffstats
path: root/lib/libfetch/common.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2008-03-20 09:55:27 +0000
committerdes <des@FreeBSD.org>2008-03-20 09:55:27 +0000
commit0b6cf6e8e482f6c5861f3e4cb67557652d1caacb (patch)
tree86f6d5e2078340286d3e3a5c5566dbd902270a41 /lib/libfetch/common.c
parent3f8f97c6e005e27ada0173e8099b8f5f22e23cb8 (diff)
downloadFreeBSD-src-0b6cf6e8e482f6c5861f3e4cb67557652d1caacb.zip
FreeBSD-src-0b6cf6e8e482f6c5861f3e4cb67557652d1caacb.tar.gz
s/wait/delta/ to avoid namespace collision.
MFC after: 2 weeks
Diffstat (limited to 'lib/libfetch/common.c')
-rw-r--r--lib/libfetch/common.c32
1 files changed, 16 insertions, 16 deletions
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;
OpenPOWER on IntegriCloud