diff options
author | Darren Tucker <dtucker@cvs.openbsd.org> | 2004-07-08 12:53:43 +0000 |
---|---|---|
committer | Darren Tucker <dtucker@cvs.openbsd.org> | 2004-07-08 12:53:43 +0000 |
commit | 0499aca30f78259cdd873073be3d71bdf0e178ac (patch) | |
tree | 780a8fd22472e8593219cdf3e4a2368847d4a14d /bin/rcp/rcp.c | |
parent | 76d9df584fa31713f4ad951d401f6c9f16c16d33 (diff) |
Prevent rcp from skipping the file following a double-error. Matches scp.c
rev 1.116, prompted by & ok markus@
Diffstat (limited to 'bin/rcp/rcp.c')
-rw-r--r-- | bin/rcp/rcp.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/bin/rcp/rcp.c b/bin/rcp/rcp.c index 9d23e6e61b6..4d7e7d658ee 100644 --- a/bin/rcp/rcp.c +++ b/bin/rcp/rcp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcp.c,v 1.39 2004/04/01 12:19:57 markus Exp $ */ +/* $OpenBSD: rcp.c,v 1.40 2004/07/08 12:53:42 dtucker Exp $ */ /* $NetBSD: rcp.c,v 1.9 1995/03/21 08:19:06 cgd Exp $ */ /* @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)rcp.c 8.2 (Berkeley) 4/2/94"; #else -static const char rcsid[] = "$OpenBSD: rcp.c,v 1.39 2004/04/01 12:19:57 markus Exp $"; +static const char rcsid[] = "$OpenBSD: rcp.c,v 1.40 2004/07/08 12:53:42 dtucker Exp $"; #endif #endif /* not lint */ @@ -738,14 +738,18 @@ bad: run_err("%s: %s", np, strerror(errno)); } if (pflag) { if (exists || omode != mode) - if (fchmod(ofd, omode)) + if (fchmod(ofd, omode)) { run_err("%s: set mode: %s", np, strerror(errno)); + wrerr = DISPLAYED; + } } else { if (!exists && omode != mode) - if (fchmod(ofd, omode & ~mask)) + if (fchmod(ofd, omode & ~mask)) { run_err("%s: set mode: %s", np, strerror(errno)); + wrerr = DISPLAYED; + } } (void)close(ofd); (void)response(); |