diff options
author | Ricardo Branco <rbranco@suse.de> | 2024-01-29 22:17:47 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2024-01-30 17:08:03 +0000 |
commit | fae467c2212ced8e82f5fa385d316445c8874941 (patch) | |
tree | 2960ac748e87ec39426169b5dfa023466183c0fa /bin | |
parent | 6c892b79de590443a180269507f61f3d8a9ec879 (diff) | |
download | src-fae467c2212ced8e82f5fa385d316445c8874941.tar.gz src-fae467c2212ced8e82f5fa385d316445c8874941.zip |
chflags(1): Fix -f option
As stated in the man page, -f must not emit warning on error, and must
not set the utility exit code.
PR: 276723
Github PR: https://github.com/freebsd/freebsd-src/pull/1088
Reviewed by: imp, kib
MFC after: 1 week
Diffstat (limited to 'bin')
-rw-r--r-- | bin/chflags/chflags.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bin/chflags/chflags.c b/bin/chflags/chflags.c index b92d5b6439f5..0972240558df 100644 --- a/bin/chflags/chflags.c +++ b/bin/chflags/chflags.c @@ -182,9 +182,11 @@ main(int argc, char *argv[]) if (newflags == p->fts_statp->st_flags) continue; if (chflagsat(AT_FDCWD, p->fts_accpath, newflags, - atflag) == -1 && !fflag) { - warn("%s", p->fts_path); - rval = 1; + atflag) == -1) { + if (!fflag) { + warn("%s", p->fts_path); + rval = 1; + } } else if (vflag || siginfo) { (void)printf("%s", p->fts_path); if (vflag > 1 || siginfo) |