From nobody Tue Feb 06 00:38:24 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 4TTPVn1ZJtz59NBn; Tue, 6 Feb 2024 00:38:25 +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 4TTPVn0W1fz4DnX; Tue, 6 Feb 2024 00:38:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707179905; 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=Y4nh/jNgqQ4K+WvcQAq0SAKHfKB9t+9bPxJnrOYWf9M=; b=Ls3h5XMgHUjCBsTyx6YQ9+o1xempsvtLHyB7xsHJ0Fquj/t3GAJ33HPdZPPAUyZcjrMS4I 6UfaNgZ9XPS0PgUafkseguVSsVCbAvHmjdOHVTQ+X0ay1jI7VL28f8plqCuljEqInCgArd lAF9Lyz3zKEktWTSwh9vPXz9044d0EDecbZnyY1t09PBCj66BHtLHAzhasXGbNS2Z07cSy QEUaJITSgKnhCdNeZabmgHcYaFUNMwBxeXTDJlkFejJw0IO5vkIOMe53dcSEv97BeHcTcC HhYiHJJ1Hez+uFPvyWkSpXCw7qZwfSRDhEWXXSjHn3q5MNVjoqMWjUIzQa4JeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1707179905; 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=Y4nh/jNgqQ4K+WvcQAq0SAKHfKB9t+9bPxJnrOYWf9M=; b=LTtm/zmXTKBquTEKOtfvjjCnvYpDWdQ+RWS7UYUVjRbAvO76wOW9XZ6P8gBJpOlyi1K++O Yp2JPVdNO/rNOv9M91zVpL3d/H1A0YeGzT0hCwlHyt7VGS3Mga15Wpdr4HwPn4SMd2E+Kq xRDxprqjyORzNl+NzOQ4V9Q4By3pQynBnorn9oAWq0RyddMlGoswTTxwM9RyhC3fGziaVi aGwjhZZ13mdz7hoVpeOK2JnnUpxjbnxMrOX1TNColnl6bSHXXMtgveoKzzEdj+ElGoUuCe GwTcj6whzHiOVL4w71YfUy75eht6ZyUAPO5CWSuUon9HyfR62htcsilVx43ZtA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1707179905; a=rsa-sha256; cv=none; b=uSFOuf3n1r+uTH6sYDCb4WcuiIzAGwoTFh9zM5aA3y36rhv7RVfMVSXTVUyNXLTLGxGeEW 5orbetlq5LFBsV9XfokGRy4lcPxaUxj2oSPl0hifcPIQzN0+q8YbpTgoiQcBUofnGZraM6 cbR4JmV4fnKG70kdiJaILdqaLKjXUJDbrBfYd+EhDWw6LDOrXXjRqNNJZQl6bRCa/Q0WMe 4n0qPUGFc4IQPk84yu/mZkfF/M2uV95gIWioh4PsWm0aZD0w73dGyaQ6wJfEF5x1QNCy8Q 9z+FBsslCGxWiJqWaqxUdINR/9fc4Ymx9jBNphid8pEZj3ek25WI5/0SoasypA== 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 4TTPVm6gsQz124B; Tue, 6 Feb 2024 00:38:24 +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 4160cOPF071274; Tue, 6 Feb 2024 00:38:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 4160cOSV071271; Tue, 6 Feb 2024 00:38:24 GMT (envelope-from git) Date: Tue, 6 Feb 2024 00:38:24 GMT Message-Id: <202402060038.4160cOSV071271@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: afb21c3a5910 - stable/14 - 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/14 X-Git-Reftype: branch X-Git-Commit: afb21c3a5910fee2e6792121302840c5c2a69369 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=afb21c3a5910fee2e6792121302840c5c2a69369 commit afb21c3a5910fee2e6792121302840c5c2a69369 Author: Konstantin Belousov AuthorDate: 2024-01-30 18:07:59 +0000 Commit: Konstantin Belousov CommitDate: 2024-02-06 00:37:37 +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 5c9a2f7e7f42..39191c9a3ae2 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)