pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/libfetch/files Don't shadow wait(2).



details:   https://anonhg.NetBSD.org/pkgsrc/rev/256a5a550fe3
branches:  trunk
changeset: 538394:256a5a550fe3
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Thu Feb 07 16:30:49 2008 +0000

description:
Don't shadow wait(2).

diffstat:

 net/libfetch/files/common.c |  34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diffs (81 lines):

diff -r ae3ced9dddf3 -r 256a5a550fe3 net/libfetch/files/common.c
--- a/net/libfetch/files/common.c       Thu Feb 07 16:24:01 2008 +0000
+++ b/net/libfetch/files/common.c       Thu Feb 07 16:30:49 2008 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: common.c,v 1.3 2008/02/07 16:24:01 joerg Exp $ */
+/*     $NetBSD: common.c,v 1.4 2008/02/07 16:30:49 joerg Exp $ */
 /*-
  * Copyright (c) 1998-2004 Dag-Erling Coïdan Smørgrav
  * All rights reserved.
@@ -384,7 +384,7 @@
 ssize_t
 fetch_read(conn_t *conn, char *buf, size_t len)
 {
-       struct timeval now, timeout, wait;
+       struct timeval now, timeout, waittv;
        fd_set readfds;
        ssize_t rlen, total;
        int r;
@@ -400,19 +400,19 @@
                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--;
+                       waittv.tv_sec = timeout.tv_sec - now.tv_sec;
+                       waittv.tv_usec = timeout.tv_usec - now.tv_usec;
+                       if (waittv.tv_usec < 0) {
+                               waittv.tv_usec += 1000000;
+                               waittv.tv_sec--;
                        }
-                       if (wait.tv_sec < 0) {
+                       if (waittv.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, &waittv);
                        if (r == -1) {
                                if (errno == EINTR && fetchRestartCalls)
                                        continue;
@@ -510,7 +510,7 @@
 ssize_t
 fetch_writev(conn_t *conn, struct iovec *iov, int iovcnt)
 {
-       struct timeval now, timeout, wait;
+       struct timeval now, timeout, waittv;
        fd_set writefds;
        ssize_t wlen, total;
        int r;
@@ -526,19 +526,19 @@
                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--;
+                       waittv.tv_sec = timeout.tv_sec - now.tv_sec;
+                       waittv.tv_usec = timeout.tv_usec - now.tv_usec;
+                       if (waittv.tv_usec < 0) {
+                               waittv.tv_usec += 1000000;
+                               waittv.tv_sec--;
                        }
-                       if (wait.tv_sec < 0) {
+                       if (waittv.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, &waittv);
                        if (r == -1) {
                                if (errno == EINTR && fetchRestartCalls)
                                        continue;



Home | Main Index | Thread Index | Old Index