summaryrefslogtreecommitdiff
path: root/lib/libfetch
diff options
context:
space:
mode:
authorBill Fenner <fenner@FreeBSD.org>2002-09-17 05:54:33 +0000
committerBill Fenner <fenner@FreeBSD.org>2002-09-17 05:54:33 +0000
commit40cfbfd5085b953f00e6fd3feb4d68ad34cf3312 (patch)
treea41fa6f3686892d2962027e74dfb5742f3f39fc4 /lib/libfetch
parent117f87fe9f2ea1cad51a75927852552a0c6f16f6 (diff)
Notes
Diffstat (limited to 'lib/libfetch')
-rw-r--r--lib/libfetch/common.c4
-rw-r--r--lib/libfetch/ftp.c5
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c
index cb69ec0f0081..4b2e6ea3fdfa 100644
--- a/lib/libfetch/common.c
+++ b/lib/libfetch/common.c
@@ -271,8 +271,10 @@ _fetch_connect(const char *host, int port, int af, int verbose)
return (NULL);
}
- if ((conn = _fetch_reopen(sd)) == NULL)
+ if ((conn = _fetch_reopen(sd)) == NULL) {
+ _fetch_syserr();
close(sd);
+ }
return (conn);
}
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c
index b08dd3077918..7897adf91e55 100644
--- a/lib/libfetch/ftp.c
+++ b/lib/libfetch/ftp.c
@@ -796,10 +796,9 @@ _ftp_connect(struct url *url, struct url *purl, const char *flags)
}
/* check connection */
- if (conn == NULL) {
- _fetch_syserr();
+ if (conn == NULL)
+ /* _fetch_connect() has already set an error code */
return (NULL);
- }
/* expect welcome message */
if ((e = _ftp_chkerr(conn)) != FTP_SERVICE_READY)