Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jan 2024 18:13:51 +0000
From:      Jessica Clarke <jrtc27@freebsd.org>
To:        Konstantin Belousov <kostikbel@gmail.com>
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:  <D407CD99-52E3-4FE2-BDB9-D5D8E6F47107@freebsd.org>
In-Reply-To: <Zbk7-tywQ4eB0fsD@kib.kiev.ua>
References:  <202401301710.40UHASqJ091254@gitrepo.freebsd.org> <5623BA44-006D-4613-81E9-0B2AE22B48DF@freebsd.org> <Zbk7-tywQ4eB0fsD@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On 30 Jan 2024, at 18:12, Konstantin Belousov <kostikbel@gmail.com> =
wrote:
>=20
> On Tue, Jan 30, 2024 at 05:22:38PM +0000, Jessica Clarke wrote:
>> 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.
>>=20
>> 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.
> Right, sorry it slipped.
>=20
>>=20
>> 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.
>=20
> This should fix siginfo.
>=20
> commit 57658578cf42fc9b6e8906a05b9effcd03a437a1
> Author: Konstantin Belousov <kib@FreeBSD.org>
> Date:   Tue Jan 30 20:07:59 2024 +0200
>=20
>    chflags(1): obey siginfo request on chflagsat(2) failure
>=20
>    Noted by:       jrtc27
>    Sponsored by:   The FreeBSD Foundation
>    MFC after:      1 week
>=20
> diff --git a/bin/chflags/chflags.c b/bin/chflags/chflags.c
> index 0972240558df..13a327d9426c 100644
> --- a/bin/chflags/chflags.c
> +++ b/bin/chflags/chflags.c
> @@ -183,10 +183,12 @@ main(int argc, char *argv[])
> continue;
> if (chflagsat(AT_FDCWD, p->fts_accpath, newflags,
>     atflag) =3D=3D -1) {
> - if (!fflag) {
> + if (!fflag || siginfo) {
> warn("%s", p->fts_path);

warn goes to stderr, it really does need to be a separate printf.

Jess

> - rval =3D 1;
> + siginfo =3D 0;
> }
> + if (!fflag)
> + 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?D407CD99-52E3-4FE2-BDB9-D5D8E6F47107>