diff options
| author | Stephen McKay <mckay@FreeBSD.org> | 2002-09-22 11:15:56 +0000 |
|---|---|---|
| committer | Stephen McKay <mckay@FreeBSD.org> | 2002-09-22 11:15:56 +0000 |
| commit | eedc99e7b5d8e5c8f1800dc4da22d5596907f66f (patch) | |
| tree | e5b1a0cbc24c17fc075af19e8c07f7fad22f9db5 | |
| parent | a0c67264729389b5daa31510ae64aee6fa4cfd6d (diff) | |
Notes
| -rw-r--r-- | bin/cp/cp.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/bin/cp/cp.c b/bin/cp/cp.c index 10072094b3f0..57c3e4d8c649 100644 --- a/bin/cp/cp.c +++ b/bin/cp/cp.c @@ -361,9 +361,10 @@ copy(char *argv[], enum op type, int fts_options) * honour setuid, setgid and sticky bits, but we * normally want to preserve them on directories. */ - if (pflag) - rval = setfile(curr->fts_statp, 0); - else { + if (pflag) { + if (setfile(curr->fts_statp, 0)) + rval = 1; + } else { mode = curr->fts_statp->st_mode; if ((mode & (S_ISUID | S_ISGID | S_ISTXT)) || ((mode | S_IRWXU) & mask) != (mode & mask)) |
