From nobody Tue Jan 30 18:12:10 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TPYD90wM6z59J8x; Tue, 30 Jan 2024 18:12:25 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4TPYD83mjkz4QBq; Tue, 30 Jan 2024 18:12:24 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.17.1/8.17.1) with ESMTP id 40UICAM4038414; Tue, 30 Jan 2024 20:12:13 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 40UICAM4038414 Received: (from kostik@localhost) by tom.home (8.17.1/8.17.1/Submit) id 40UICAY3038413; Tue, 30 Jan 2024 20:12:10 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 30 Jan 2024 20:12:10 +0200 From: Konstantin Belousov To: Jessica Clarke Cc: "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: fae467c2212c - main - chflags(1): Fix -f option Message-ID: References: <202401301710.40UHASqJ091254@gitrepo.freebsd.org> <5623BA44-006D-4613-81E9-0B2AE22B48DF@freebsd.org> List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5623BA44-006D-4613-81E9-0B2AE22B48DF@freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.0 X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-14) on tom.home X-Rspamd-Queue-Id: 4TPYD83mjkz4QBq X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] On Tue, Jan 30, 2024 at 05:22:38PM +0000, Jessica Clarke wrote: > On 30 Jan 2024, at 17:10, Konstantin Belousov wrote: > > > > The branch main has been updated by kib: > > > > URL: https://cgit.FreeBSD.org/src/commit/?id=fae467c2212ced8e82f5fa385d316445c8874941 > > > > commit fae467c2212ced8e82f5fa385d316445c8874941 > > Author: Ricardo Branco > > AuthorDate: 2024-01-29 22:17:47 +0000 > > Commit: Konstantin Belousov > > CommitDate: 2024-01-30 17:08:03 +0000 > > > > 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. > > 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’t. Right, sorry it slipped. > > But I’m also not entirely convinced this new code is right with respect > to SIGINFO, as it won’t print anything until it reaches a file that > doesn’t cause an error? I’d normally expect SIGINFO to tell me exactly > what it is doing or just did. This should fix siginfo. commit 57658578cf42fc9b6e8906a05b9effcd03a437a1 Author: Konstantin Belousov Date: Tue Jan 30 20:07:59 2024 +0200 chflags(1): obey siginfo request on chflagsat(2) failure Noted by: jrtc27 Sponsored by: The FreeBSD Foundation MFC after: 1 week 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) == -1) { - if (!fflag) { + if (!fflag || siginfo) { warn("%s", p->fts_path); - rval = 1; + siginfo = 0; } + if (!fflag) + rval = 1; } else if (vflag || siginfo) { (void)printf("%s", p->fts_path); if (vflag > 1 || siginfo)