From 52c251848d3e688cbaa888abe16286bc26a51aad Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Thu, 13 Jul 2000 23:19:32 +0000 Subject: close can fail on AFS, report error; from Greg Hudson --- usr.bin/ssh/scp.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'usr.bin/ssh/scp.c') diff --git a/usr.bin/ssh/scp.c b/usr.bin/ssh/scp.c index c0874a65ef5..e0015bb9817 100644 --- a/usr.bin/ssh/scp.c +++ b/usr.bin/ssh/scp.c @@ -45,7 +45,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: scp.c,v 1.32 2000/06/20 01:39:44 markus Exp $"); +RCSID("$OpenBSD: scp.c,v 1.33 2000/07/13 23:19:31 provos Exp $"); #include "ssh.h" #include "xmalloc.h" @@ -881,7 +881,10 @@ bad: run_err("%s: %s", np, strerror(errno)); run_err("%s: set mode: %s", np, strerror(errno)); } - (void) close(ofd); + if (close(ofd) == -1) { + wrerr = YES; + wrerrno = errno; + } (void) response(); if (setimes && wrerr == NO) { setimes = 0; @@ -1005,7 +1008,7 @@ run_err(const char *fmt,...) * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: scp.c,v 1.32 2000/06/20 01:39:44 markus Exp $ + * $OpenBSD: scp.c,v 1.33 2000/07/13 23:19:31 provos Exp $ */ char * -- cgit v1.2.3