From nobody Tue Feb 6 00:39:22 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 4TTPWt377Hz59NQj; Tue, 6 Feb 2024 00:39:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TTPWt1yXLz4Fd5; Tue, 6 Feb 2024 00:39:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707179962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+5staT/B+OsDX3y43WVS92KfXMnaozPEaG5Z0cLFhrY=; b=A6Cv9iVoLrtI6iVzntqn1rIz2AFsVcs7AADW2FzR1x3A5C1o7LKfhlIrcCipQzq/VpbC1N 1wllW+pxAd2H70B7q3/dn200LD1zdAs6PCvgmLWF0STWPr+d049AEqxNLZJeU2hnQV+hfO HDZoKMKre7hR13kptypFt3Q6qcOKVYN7zrEHDHGZ/R4edFj2m/M58n1FC6JuAFhLh/9MOM 9wxz3/wFM9JaLpkJec6ZBT7zQlnwVAjFZY6gLfXYP1sFoF8rsqd8b07f9qL3gdsFzAe+Io uVeIPJNPeOZJJO43kFgs0rNQrl+FXDvTGCu8HD37TnEZ/YhTRWxKWaedjn+zvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707179962; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+5staT/B+OsDX3y43WVS92KfXMnaozPEaG5Z0cLFhrY=; b=rg057LpKiXdqaycBwG186ow448BXADIZ8H/beVOpZrf7cMr//vGkWnInID5C0hSgl/4ZIO Afu5h7HKGRBQ6NmxahLKmmz26yEkysNrM6Ejkp+AH83fa6FvUxl9rU8eH4x3qtICvMrCU5 NEUEtXAT5j0lSeoE5V/dkzldOAEde0tTiRpnKnP8qtJl4ocJYIcls7kPHoGDG/JJi/LFhq QhueLeCnGzZimHG2jK7PQKm+LtU3O247doYVpI6S7iALFi0HiyvV/AjKe/wARMK+GfRiqN zZ+g6h6+EFbAeoCwqfTskEcIuvf86T/7irQZCsQE+QoOvt2wo72wfKqo0zwW4w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707179962; a=rsa-sha256; cv=none; b=qtoP+YBbmyBaZDMr9mjMmrq+Fh/0H+AGIfc+egIrSBQv/mRe7aeLT+Gott32wOIAlnI0/7 6Jcn0pGSEJpQGGe+igBq5fXTCgafEK5uwS/x2rYfm8Tk5o8bnHSBZVpBRa5rfJRfX8/jYQ t2CJUsW9uIm19TOo9wcyeDctXKzDOGNurLyXskOkRH4G19s3+MMvWsEbx/u1lwKaw7MAXd nJYrWvmaNieK+dlbG+sS2cGzWmZUV78nwznVBizikS6j1+eN0XW2Mz5SmByh+LqJKFTL6Y MzUxAcVIBLjQ2OjQGyTex1/LGzzeoHfE+BI3wvaTlcZ0PSVx78LUcxmr6UQK9A== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TTPWt0vhRz129Z; Tue, 6 Feb 2024 00:39:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4160dM0b071583; Tue, 6 Feb 2024 00:39:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4160dMnX071580; Tue, 6 Feb 2024 00:39:22 GMT (envelope-from git) Date: Tue, 6 Feb 2024 00:39:22 GMT Message-Id: <202402060039.4160dMnX071580@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: dc30b2841b7d - stable/13 - chflags(1): obey siginfo request on chflagsat(2) failure 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-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: dc30b2841b7d9903f543f69ac10c8ebe6c6ecc69 Auto-Submitted: auto-generated The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=dc30b2841b7d9903f543f69ac10c8ebe6c6ecc69 commit dc30b2841b7d9903f543f69ac10c8ebe6c6ecc69 Author: Konstantin Belousov AuthorDate: 2024-01-30 18:07:59 +0000 Commit: Konstantin Belousov CommitDate: 2024-02-06 00:38:35 +0000 chflags(1): obey siginfo request on chflagsat(2) failure (cherry picked from commit 2954af09f143ed1e484f7ca520e0d2611101e248) --- bin/chflags/chflags.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/chflags/chflags.c b/bin/chflags/chflags.c index 81fb6708ae34..06cbd984128a 100644 --- a/bin/chflags/chflags.c +++ b/bin/chflags/chflags.c @@ -74,7 +74,7 @@ main(int argc, char *argv[]) u_long clear, newflags, set; long val; int Hflag, Lflag, Rflag, fflag, hflag, vflag, xflag; - int ch, fts_options, oct, rval; + int ch, e, fts_options, oct, rval; char *flags, *ep; Hflag = Lflag = Rflag = fflag = hflag = vflag = xflag = 0; @@ -196,10 +196,16 @@ main(int argc, char *argv[]) continue; if (chflagsat(AT_FDCWD, p->fts_accpath, newflags, atflag) == -1) { + e = errno; if (!fflag) { - warn("%s", p->fts_path); + warnc(e, "%s", p->fts_path); rval = 1; } + if (siginfo) { + (void)printf("%s: %s\n", p->fts_path, + strerror(e)); + siginfo = 0; + } } else if (vflag || siginfo) { (void)printf("%s", p->fts_path); if (vflag > 1 || siginfo)