From nobody Mon Jun 16 08:54:13 2025 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 4bLP1x3XKNz5Vpm8; Mon, 16 Jun 2025 08:54:13 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bLP1x1bJHz3wxQ; Mon, 16 Jun 2025 08:54:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064053; 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=Fq3JIfTCi6dxf+wNZzZ03RNYhmbc88pQMA3eGf0KTPw=; b=RDtr1ieCROVqis5nLU8lubOGQyY5Z9RRkZC0LCRxFQ2w7ZgOh0fwvfxOP8QEyq67bXb7Si 78X9ANkjqOYKJYmjkq6163KQDEgPnYzGG3JEtxgqWnDmPhulg24Y8ykeThHRoevJNwS5nz SZUxn6KuYNX2RdyoQRxkC4qJAPEGh01V/tVsrKiI2zkvzIrvn62OP6Fy63LRjA7+mKbJNy umwt8c6RTyQk32hAS9W2Iac8dX0JRO83+Iy+owubzK2sJlDuK4pIz/b6pDnTjHizmfXBTG Yatb7DllIQkx5vnIW2C9frTRhC24rnF/H5VOjMJj4tgqa9zLC9PAR+gJcMKBTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750064053; 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=Fq3JIfTCi6dxf+wNZzZ03RNYhmbc88pQMA3eGf0KTPw=; b=x2/z5uF6i9a8/VHaKMSlFZohcNwO7hdMmypLjiZn8LbjCujTZi9d2IDZ58cnr+ZZLpDIUm IxP9N2u4gkosiku8ThN9GNDSE1SX7bw7juFbGzl4KaNDhaJb587XCoq0Oj0XfjR43HXSEq taQuF8ysxYMAPBKHfTLIx6nE++he11TK+wH7JF5+j5HsVbYuf2EcjhOWq99fEpmxba8WlY uuI2qhr0sw9jdCKeFi+7SWs2rT/KtgYoNlhSqp3VQ+QRTV3W70PZlAl8FW7fOwkVb1JoSp bFOl5igls3i6+yabj0d8deno40lzczDS6UHBNEM70GC2bNT3wRrPqzcq76lyJQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750064053; a=rsa-sha256; cv=none; b=ix3bl6j/K0MrjgsI9lhFi5zQfPMrFCjed03sq5g5aguFNbcK6PxmDTR7MR4WUN2uv2kUyU zP/IjqGcVcBEw0Ht3RS41cqR16daZNxJ/BUfJYqxBoAp11xQtWGer5s5EwACx7stUdmnwO SQaZCKVxjj9GQ1PRdBgDbAVhs87emwj8WOFzoahLAJIcXhmeFO9SFrhB2giTVeMeHf103L rzbuDG0nUMu4amtT9Y9OqU9y0V+eX8uvHm/vuXzPC8y/YK0XHunhcKD27WRrfyzEyD4UVS HkRPPsfgTxnc/0eGmWGwweP+GYCExQQnFZF0pStN7VnTDmY5BwP2gRBfenrwGA== 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 4bLP1x19r7zrkN; Mon, 16 Jun 2025 08:54:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55G8sDJL043588; Mon, 16 Jun 2025 08:54:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55G8sDvh043585; Mon, 16 Jun 2025 08:54:13 GMT (envelope-from git) Date: Mon, 16 Jun 2025 08:54:13 GMT Message-Id: <202506160854.55G8sDvh043585@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: 1adea6e97f81 - stable/14 - timeout(1): print errno when signalling syscalls failed 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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: 1adea6e97f814194d986daeaf2ae1327183a6156 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=1adea6e97f814194d986daeaf2ae1327183a6156 commit 1adea6e97f814194d986daeaf2ae1327183a6156 Author: Konstantin Belousov AuthorDate: 2025-06-07 11:29:15 +0000 Commit: Konstantin Belousov CommitDate: 2025-06-16 08:51:54 +0000 timeout(1): print errno when signalling syscalls failed (cherry picked from commit bff05e8a8c3c64bfe6152870cb758d00991ec66b) --- bin/timeout/timeout.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bin/timeout/timeout.c b/bin/timeout/timeout.c index 424e72dac9ad..05904522c5b5 100644 --- a/bin/timeout/timeout.c +++ b/bin/timeout/timeout.c @@ -195,7 +195,7 @@ send_sig(pid_t pid, int signo, bool foreground) if (foreground) { if (kill(pid, signo) == -1) { if (errno != ESRCH) - warnx("kill(%d, %s)", (int)pid, + warn("kill(%d, %s)", (int)pid, sys_signame[signo]); } } else { @@ -204,11 +204,13 @@ send_sig(pid_t pid, int signo, bool foreground) error = procctl(P_PID, getpid(), PROC_REAP_KILL, &rk); if (error == 0 || (error == -1 && errno == ESRCH)) ; - else if (error == -1) - warnx("procctl(PROC_REAP_KILL)"); - else if (rk.rk_fpid > 0) - warnx("failed to signal some processes: first pid=%d", - (int)rk.rk_fpid); + else if (error == -1) { + warn("procctl(PROC_REAP_KILL)"); + if (rk.rk_fpid > 0) + warnx( + "failed to signal some processes: first pid=%d", + (int)rk.rk_fpid); + } logv("signaled %u processes", rk.rk_killed); }