diff options
author | Jim Meyering <jim@meyering.net> | 1996-09-06 03:00:56 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1996-09-06 03:00:56 +0000 |
commit | 71066e34b90cba361958688983cdb07c1b72c1a3 (patch) | |
tree | 62da9fb6be868e66d1aeaba20770fed01a05966b /src | |
parent | 4be8ee6d7596033bfa592ab94af43736cc6ad9a6 (diff) | |
download | coreutils-71066e34b90cba361958688983cdb07c1b72c1a3.tar.xz |
(main): Don't set verbose flag for --changes.
(change_file_mode): If chmod succeeds and --changes was given,
give a diagnostic describing the new permissions.
Reported by Philippe Schnoebelen (phs@fing.edu.uy).
Diffstat (limited to 'src')
-rw-r--r-- | src/chmod.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/chmod.c b/src/chmod.c index 2308d804f..63a54e3b0 100644 --- a/src/chmod.c +++ b/src/chmod.c @@ -133,7 +133,12 @@ change_file_mode (const char *file, const struct mode_change *changes, { if (verbose) describe_change (file, newmode, 1); - if (chmod (file, (int) newmode)) + if (chmod (file, (int) newmode) == 0) + { + if (changes_only) + describe_change (file, newmode, 1); + } + else { if (force_silent == 0) error (0, errno, "%s", file); @@ -285,7 +290,6 @@ main (int argc, char **argv) recurse = 1; break; case 'c': - verbose = 1; changes_only = 1; break; case 'f': |