Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jan 2024 17:22:38 +0000
From:      Jessica Clarke <jrtc27@freebsd.org>
To:        Konstantin Belousov <kib@FreeBSD.org>
Cc:        "src-committers@freebsd.org" <src-committers@FreeBSD.org>, "dev-commits-src-all@freebsd.org" <dev-commits-src-all@FreeBSD.org>, "dev-commits-src-main@freebsd.org" <dev-commits-src-main@FreeBSD.org>
Subject:   Re: git: fae467c2212c - main - chflags(1): Fix -f option
Message-ID:  <5623BA44-006D-4613-81E9-0B2AE22B48DF@freebsd.org>
In-Reply-To: <202401301710.40UHASqJ091254@gitrepo.freebsd.org>
References:  <202401301710.40UHASqJ091254@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 30 Jan 2024, at 17:10, Konstantin Belousov <kib@FreeBSD.org> wrote:
>=20
> The branch main has been updated by kib:
>=20
> URL: =
https://cgit.FreeBSD.org/src/commit/?id=3Dfae467c2212ced8e82f5fa385d316445=
c8874941
>=20
> commit fae467c2212ced8e82f5fa385d316445c8874941
> Author:     Ricardo Branco <rbranco@suse.de>
> AuthorDate: 2024-01-29 22:17:47 +0000
> Commit:     Konstantin Belousov <kib@FreeBSD.org>
> CommitDate: 2024-01-30 17:08:03 +0000
>=20
>    chflags(1): Fix -f option
>=20
>    As stated in the man page, -f must not emit warning on error, and =
must
>    not set the utility exit code.

But that was already true of the code; this is not what the bug fix is.
The problem was that it would print out the filename with -v (and flags
change attempted with -vv) as if it succeeded, when it didn=E2=80=99t.

But I=E2=80=99m also not entirely convinced this new code is right with =
respect
to SIGINFO, as it won=E2=80=99t print anything until it reaches a file =
that
doesn=E2=80=99t cause an error? I=E2=80=99d normally expect SIGINFO to =
tell me exactly
what it is doing or just did.

Jess

>    PR:     276723
>    Github PR:      https://github.com/freebsd/freebsd-src/pull/1088
>    Reviewed by:    imp, kib
>    MFC after:      1 week
> ---
> bin/chflags/chflags.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>=20
> 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 =3D=3D p->fts_statp->st_flags)
> continue;
> if (chflagsat(AT_FDCWD, p->fts_accpath, newflags,
> -    atflag) =3D=3D -1 && !fflag) {
> - warn("%s", p->fts_path);
> - rval =3D 1;
> +    atflag) =3D=3D -1) {
> + if (!fflag) {
> + warn("%s", p->fts_path);
> + rval =3D 1;
> + }
> } else if (vflag || siginfo) {
> (void)printf("%s", p->fts_path);
> if (vflag > 1 || siginfo)




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5623BA44-006D-4613-81E9-0B2AE22B48DF>