diff options
Diffstat (limited to 'scp.c')
-rw-r--r-- | scp.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -71,7 +71,7 @@ | |||
71 | */ | 71 | */ |
72 | 72 | ||
73 | #include "includes.h" | 73 | #include "includes.h" |
74 | RCSID("$OpenBSD: scp.c,v 1.115 2004/06/21 17:36:31 avsm Exp $"); | 74 | RCSID("$OpenBSD: scp.c,v 1.116 2004/07/08 12:47:21 dtucker Exp $"); |
75 | 75 | ||
76 | #include "xmalloc.h" | 76 | #include "xmalloc.h" |
77 | #include "atomicio.h" | 77 | #include "atomicio.h" |
@@ -946,21 +946,25 @@ bad: run_err("%s: %s", np, strerror(errno)); | |||
946 | if (pflag) { | 946 | if (pflag) { |
947 | if (exists || omode != mode) | 947 | if (exists || omode != mode) |
948 | #ifdef HAVE_FCHMOD | 948 | #ifdef HAVE_FCHMOD |
949 | if (fchmod(ofd, omode)) | 949 | if (fchmod(ofd, omode)) { |
950 | #else /* HAVE_FCHMOD */ | 950 | #else /* HAVE_FCHMOD */ |
951 | if (chmod(np, omode)) | 951 | if (chmod(np, omode)) { |
952 | #endif /* HAVE_FCHMOD */ | 952 | #endif /* HAVE_FCHMOD */ |
953 | run_err("%s: set mode: %s", | 953 | run_err("%s: set mode: %s", |
954 | np, strerror(errno)); | 954 | np, strerror(errno)); |
955 | wrerr = DISPLAYED; | ||
956 | } | ||
955 | } else { | 957 | } else { |
956 | if (!exists && omode != mode) | 958 | if (!exists && omode != mode) |
957 | #ifdef HAVE_FCHMOD | 959 | #ifdef HAVE_FCHMOD |
958 | if (fchmod(ofd, omode & ~mask)) | 960 | if (fchmod(ofd, omode & ~mask)) { |
959 | #else /* HAVE_FCHMOD */ | 961 | #else /* HAVE_FCHMOD */ |
960 | if (chmod(np, omode & ~mask)) | 962 | if (chmod(np, omode & ~mask)) { |
961 | #endif /* HAVE_FCHMOD */ | 963 | #endif /* HAVE_FCHMOD */ |
962 | run_err("%s: set mode: %s", | 964 | run_err("%s: set mode: %s", |
963 | np, strerror(errno)); | 965 | np, strerror(errno)); |
966 | wrerr = DISPLAYED; | ||
967 | } | ||
964 | } | 968 | } |
965 | if (close(ofd) == -1) { | 969 | if (close(ofd) == -1) { |
966 | wrerr = YES; | 970 | wrerr = YES; |