diff options
author | Moritz Jodeit <moritz@cvs.openbsd.org> | 2006-01-10 18:12:47 +0000 |
---|---|---|
committer | Moritz Jodeit <moritz@cvs.openbsd.org> | 2006-01-10 18:12:47 +0000 |
commit | 1205026805fe3fe33f52534c09ec16a885c605a6 (patch) | |
tree | f78b75c892b5d8c10524b57158ab4d5bbdd85213 | |
parent | 222e8fbce3bdc65dc7d7dc153e907deaef2ecbdd (diff) |
Prevent close() from clobbering errno. ok otto@ deraadt@
From Ray Lai
-rw-r--r-- | usr.bin/ftp/ftp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c index 359783729f2..d9a0063d864 100644 --- a/usr.bin/ftp/ftp.c +++ b/usr.bin/ftp/ftp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ftp.c,v 1.59 2005/11/13 20:26:09 deraadt Exp $ */ +/* $OpenBSD: ftp.c,v 1.60 2006/01/10 18:12:46 moritz Exp $ */ /* $NetBSD: ftp.c,v 1.27 1997/08/18 10:20:23 lukem Exp $ */ /* @@ -60,7 +60,7 @@ */ #if !defined(lint) && !defined(SMALL) -static char rcsid[] = "$OpenBSD: ftp.c,v 1.59 2005/11/13 20:26:09 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: ftp.c,v 1.60 2006/01/10 18:12:46 moritz Exp $"; #endif /* not lint and not SMALL */ #include <sys/types.h> @@ -200,7 +200,9 @@ hookup(char *host, char *port) warn("connect to address %s", hbuf); } cause = "connect"; + error = errno; close(s); + errno = error; s = -1; continue; } |