summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2006-02-01 09:19:08 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2006-02-01 09:19:08 +0000
commitaa245bd548e28d336e9f89b65a0bad3eea52d3ad (patch)
tree3a699f7c11c35f1a48d9f7b1bc5cc2d7bae6f722 /usr.bin
parent52cf99515a04b6975a2143d1b79d007ecefd8825 (diff)
save errno, from Ray Lai in PR 4999.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ftp/fetch.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c
index 92780f6f34e..766597894a4 100644
--- a/usr.bin/ftp/fetch.c
+++ b/usr.bin/ftp/fetch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fetch.c,v 1.56 2005/08/05 21:01:53 fgsch Exp $ */
+/* $OpenBSD: fetch.c,v 1.57 2006/02/01 09:19:07 otto Exp $ */
/* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */
/*-
@@ -38,7 +38,7 @@
*/
#if !defined(lint) && !defined(SMALL)
-static char rcsid[] = "$OpenBSD: fetch.c,v 1.56 2005/08/05 21:01:53 fgsch Exp $";
+static char rcsid[] = "$OpenBSD: fetch.c,v 1.57 2006/02/01 09:19:07 otto Exp $";
#endif /* not lint and not SMALL */
/*
@@ -309,9 +309,13 @@ url_get(const char *origline, const char *proxyenv, const char *outfile)
again:
if (connect(s, res->ai_addr, res->ai_addrlen) < 0) {
+ int save_errno;
+
if (errno == EINTR)
goto again;
+ save_errno = errno;
close(s);
+ errno = save_errno;
s = -1;
cause = "connect";
continue;