diff options
Diffstat (limited to 'contrib/lukemftp/src/ftp.c')
-rw-r--r-- | contrib/lukemftp/src/ftp.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/contrib/lukemftp/src/ftp.c b/contrib/lukemftp/src/ftp.c index ad3aa47c0b86..0c3b3d4c85f8 100644 --- a/contrib/lukemftp/src/ftp.c +++ b/contrib/lukemftp/src/ftp.c @@ -1,4 +1,4 @@ -/* $NetBSD: ftp.c,v 1.122 2003/08/07 11:13:55 agc Exp $ */ +/* $NetBSD: ftp.c,v 1.125 2004/04/10 12:21:39 lukem Exp $ */ /*- * Copyright (c) 1996-2002 The NetBSD Foundation, Inc. @@ -99,7 +99,7 @@ #if 0 static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94"; #else -__RCSID("$NetBSD: ftp.c,v 1.122 2003/08/07 11:13:55 agc Exp $"); +__RCSID("$NetBSD: ftp.c,v 1.125 2004/04/10 12:21:39 lukem Exp $"); #endif #endif /* not lint */ @@ -230,10 +230,7 @@ hookup(char *host, char *port) cause = "socket"; continue; } - while ((error = xconnect(s, res->ai_addr, res->ai_addrlen)) < 0 - && errno == EINTR) { - ; - } + error = xconnect(s, res->ai_addr, res->ai_addrlen); if (error) { /* this "if" clause is to prevent print warning twice */ if (res->ai_next) { @@ -276,7 +273,8 @@ hookup(char *host, char *port) int tos = IPTOS_LOWDELAY; if (setsockopt(s, IPPROTO_IP, IP_TOS, (char *)&tos, sizeof(int)) < 0) - warn("setsockopt TOS (ignored)"); + if (debug) + warn("setsockopt TOS (ignored)"); } #endif cin = fdopen(s, "r"); @@ -573,13 +571,13 @@ empty(FILE *cin, FILE *din, int sec) struct pollfd pfd[2]; if (cin) { - pfd[nfd].fd = fileno(cin); - pfd[nfd++].events = POLLIN; + pfd[nfd].fd = fileno(cin); + pfd[nfd++].events = POLLIN; } if (din) { - pfd[nfd].fd = fileno(din); - pfd[nfd++].events = POLLIN; + pfd[nfd].fd = fileno(din); + pfd[nfd++].events = POLLIN; } if ((nr = poll(pfd, nfd, sec * 1000)) <= 0) @@ -1325,7 +1323,8 @@ initconn(void) if ((options & SO_DEBUG) && setsockopt(data, SOL_SOCKET, SO_DEBUG, (char *)&on, sizeof(on)) < 0) - warn("setsockopt (ignored)"); + if (debug) + warn("setsockopt (ignored)"); result = COMPLETE + 1; switch (data_addr.su_family) { case AF_INET: @@ -1544,8 +1543,6 @@ initconn(void) while (xconnect(data, (struct sockaddr *)&data_addr.si_su, data_addr.su_len) < 0) { - if (errno == EINTR) - continue; if (activefallback) { (void)close(data); data = -1; @@ -1563,7 +1560,8 @@ initconn(void) on = IPTOS_THROUGHPUT; if (setsockopt(data, IPPROTO_IP, IP_TOS, (char *)&on, sizeof(int)) < 0) - warn("setsockopt TOS (ignored)"); + if (debug) + warn("setsockopt TOS (ignored)"); } #endif return (0); @@ -1596,7 +1594,8 @@ initconn(void) if (options & SO_DEBUG && setsockopt(data, SOL_SOCKET, SO_DEBUG, (char *)&on, sizeof(on)) < 0) - warn("setsockopt (ignored)"); + if (debug) + warn("setsockopt (ignored)"); len = sizeof(data_addr.si_su); memset((char *)&data_addr, 0, sizeof (data_addr)); if (getsockname(data, (struct sockaddr *)&data_addr.si_su, &len) < 0) { @@ -1696,7 +1695,8 @@ initconn(void) on = IPTOS_THROUGHPUT; if (setsockopt(data, IPPROTO_IP, IP_TOS, (char *)&on, sizeof(int)) < 0) - warn("setsockopt TOS (ignored)"); + if (debug) + warn("setsockopt TOS (ignored)"); } #endif return (0); @@ -1729,7 +1729,8 @@ dataconn(const char *lmode) int tos = IPTOS_THROUGHPUT; if (setsockopt(s, IPPROTO_IP, IP_TOS, (char *)&tos, sizeof(int)) < 0) { - warn("setsockopt TOS (ignored)"); + if (debug) + warn("setsockopt TOS (ignored)"); } } #endif |