From nobody Tue Sep 10 19:00:50 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 4X3Chf41Ssz5WSlg; Tue, 10 Sep 2024 19:00:50 +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 4X3Chf2sjCz4RQG; Tue, 10 Sep 2024 19:00:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725994850; 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=triICMGb5IfyuyavyIbmjKQ+Rjr1etaZaaPQepZKZV4=; b=ZzR783mvZOYGXjcCBa7uPaD+lHojSRnD2rd8gW8xlS+l75xjaXFnZquc1OXUpyBzIN1TZQ UMW8b2VhuPRsF5n6UeH1fBypo52JCWuReoPjMXdQzTrZDgino0ul56kruNDSnqQ2Qiflq1 briSbU4heF4n9nV25HB0FoHHx8qgi3lFEZz+iJbNv7Nhl5J+5zQxgensAqhGngjCAJU0U7 OMpRJRQ9FJXwXjaFrGfJvr/4DcqesxZNb8SwmpW9kIRsQz23a7d946F/JTfSO48qSaVUTt KC6ft31NNo7JliHuAp8qteinnq/NC2DK4WzWqqXFjBp29ZlORZMcX+1j6AwXqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725994850; a=rsa-sha256; cv=none; b=mNpbtlMn8nXnqqh6zn3nDZc4MVqCPqA+T4ARMjuAzDq3jHhihSkhhOhramT92xoI7gfNtX 74tuNEKCztGu270MHaG7Up8tXibrqckbIvQyru+cKgd2XPcz5dSV923GcPHs2cI1bdyiRh LifaQqTk6/bA5jgVfoG01xPydKtRnE96MwIB5KOR38UgEAzM4j/XHOh5Ys61NX1dwgXZvt 3eBuECWIUY1FF9tNu/I7vGgnY+v7sHTiArsVYICT3HfBD+Z/npxXN7/2tOoez/WYXEh272 KMjo4SkqK4Zqr2JizaVYa7XIzjOfA9IMELsUrqmHuxoGAPqWEkDHiTQCSaRGig== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725994850; 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=triICMGb5IfyuyavyIbmjKQ+Rjr1etaZaaPQepZKZV4=; b=uSZcYAXXc5O351QE+GEo+7xcdprzvW2txpCCxfgYpWN8F08S73HaFgM+EAeH5VNHhFM3lg Z1yBN1OLJxA0SGLBSMvyF0sukmm3F3Mc2QDI9y57U+EQwheqUjpsvc5JNdsuTgG5l/FA9r O0z3SKsqtqc4rNbKOqwPZpfiQRkzT0TM8g8ZQaLGqX7l8GF+gXbzKWjxiD1w4hK6+6rvXY gM/mkHYFNVSf/rvEmAWuDay94UYNunarwCBNRB6sDfpWUY7v+D2xXaumlp75Wp+XfYU/XW jLXeJ+RaG2bDK2EmP8LtP9SbkpIUYSz6l87EpzTZQ5e+LpEUF83mraxudGLvEA== 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 4X3Chf2Sn8zySk; Tue, 10 Sep 2024 19:00:50 +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 48AJ0oHO000257; Tue, 10 Sep 2024 19:00:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48AJ0oPJ000254; Tue, 10 Sep 2024 19:00:50 GMT (envelope-from git) Date: Tue, 10 Sep 2024 19:00:50 GMT Message-Id: <202409101900.48AJ0oPJ000254@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "R. Christian McDonald" Subject: git: b5f6beefa00a - main - rc.subr: ensure run_rc_script return code is not masked by DebugOff 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: rcm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: b5f6beefa00abf9ef51d4c53563f46c5a388a18e Auto-Submitted: auto-generated The branch main has been updated by rcm: URL: https://cgit.FreeBSD.org/src/commit/?id=b5f6beefa00abf9ef51d4c53563f46c5a388a18e commit b5f6beefa00abf9ef51d4c53563f46c5a388a18e Author: R. Christian McDonald AuthorDate: 2024-09-10 15:58:57 +0000 Commit: R. Christian McDonald CommitDate: 2024-09-10 18:58:47 +0000 rc.subr: ensure run_rc_script return code is not masked by DebugOff Ensure that run_rc_script returns the true return code of the rc command and not the return code of DebugOff Reviewed by: sjg Approved by: kp MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D46626 --- libexec/rc/rc.subr | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/libexec/rc/rc.subr b/libexec/rc/rc.subr index 145b626aa01e..4bb2333addc2 100644 --- a/libexec/rc/rc.subr +++ b/libexec/rc/rc.subr @@ -1844,7 +1844,7 @@ run_rc_script() trap "echo Script $_file running >&2" 29 set $_arg; . $_file ) fi - DebugOff $_file $_file:$_arg rc:${_file##*/} rc:${_file##*/}:$_arg ${_file##*/} ${_file##*/}:$_arg + DebugOff rc=$? $_file $_file:$_arg rc:${_file##*/} rc:${_file##*/}:$_arg ${_file##*/} ${_file##*/}:$_arg fi ;; esac @@ -2769,7 +2769,18 @@ $_DEBUG_SH vdot /libexec/debug.sh # safe_eval.sh are not found. if ! have DebugOn; then DebugOn() { return 0; } - DebugOff() { return 0; } + DebugOff() { + local _rc=0 + while : + do + case "$1" in + -[eo]) shift;; # ignore it + rc=*) eval "_$1"; shift;; + *) break;; + esac + done + return $_rc + } fi if ! have save_dot; then safe_dot() { dot "$@"; }