Adjust chmod and chown to be similar if -c or -v are given. In
authorJim Meyering <jim@meyering.net>
Wed, 9 Jun 2004 09:05:02 +0000 (09:05 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 9 Jun 2004 09:05:02 +0000 (09:05 +0000)
commitbc580f6a56c591fa2cf99acba4276c4773f609a8
tree464e6ad1f6c19b5d781dca92a5102b4d04e8faa3
parent91476b4612a82ca124e2ce4eaa134d88a12c341c
Adjust chmod and chown to be similar if -c or -v are given.  In
particular, a no-op chown is no longer reported as a change; this
reverts to previous behavior.  Also, fix both commands so that -v
report failures even if the failure is not due to the chmod or
chown syscalls.

* src/chmod.c (CH_NOT_APPLIED): New constant.
(describe_change): Handle it.
(process_file): Use it, if a symlink wasn't changed.
(mode_changed): Return bool, not int.  Accept new argument
NEW_MODE; all callers changed.  This lets us avoid statting the
file unless the new mode has unusual bits.
(process_file): Return -1 on error.  With -v, report all errors
verbosely, not just some.
src/chmod.c