From nobody Wed Nov 25 21:51:24 2026 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 4jZYKT0MD6z72HHR for ; Wed, 25 Nov 2026 21:51: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) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 4jZYKS1fccz4lGt for ; Wed, 25 Nov 2026 21:51:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795643484; 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=Ys/uQDRIAvdM1g9gROZ/AVZc1ZhFb6gfg3O8nf/LhOM=; b=yJox7S7IfBuw3Z7jsQt1aFaLZpsw5PV0hPhq7XG9ZDmCkxJNJZ4PNuGMCAD68HuOEy0xki 5F+WoCocf7xvmeAQgdJ31JR93NhJ0QVXbG9a5AxW63M2GxxWJfV2HBPD1F4zJ4FV5NfLTx z4A6HukJZT9V2X+QSpqU3nghRO06tsg+f0e+MRNpj040I8uewngqS047TuNQW/TzGwp/wV cj/BXBlNcoGfs+HEX258d++xqUwgC/Kaizw7HDZxtVTQuE0GrzAF1IQZw6lOQDCvlYIA1c 4mMAS1+jHKlyuIVhYfqBNC02A3+kgIv/MuQ6/DSkowEXcEZ2VdohsE15d8WjGg== ARC-Seal: i=1; a=rsa-sha256; d=freebsd.org; s=dkim; cv=none; t=1795643484; b=EF89CYsCP+BI/fmRqclm4P50+nQ8RbAhkCmFoy6SmBFD2o0dxCEqcu/U2UhJNwbYb1DmoJ Kj9O32CFdhCmhhrA1NneJWozciJs1gMWqfREoqCcp74zK9wFx3ePajKkuDqcWrEzMFBCXo uFQuDDx55QaocQBD6Vm0tYcLAUhNGlTNI6kVl+RcEcEaG5J23FloGePAbr8zntcq8+SniL Xqh0ULOgB7x2LeomGFeqHB5zStYeNjizSVWU2xdXvFpAyXsD8qQ7ZBz/l3sY4x15ru6VW7 vh3hS1TXdwbVwqWuxKTkDnjV645i4CAbtjN+RAQaJnf7My2rEwe9B8bFRhtbJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1795643484; 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=Ys/uQDRIAvdM1g9gROZ/AVZc1ZhFb6gfg3O8nf/LhOM=; b=egr2oWvatcF2CD9qVmmfUgnOQAVAmx+vvMu7tTLPOPMV/w9c3up3noCLmLMIARAWVDR9W8 TgGt5j0aODL3M1YecV+W6BVXJI0nTNYS0Z5w0PZfZpmrjmmolnvL9mJMfyBVOKKDoaO98i SHH9Si89bSwaKaNe2xKkyjrbSMH3Uiq2HOIj1DK5j9sruvJ1ygyd4/iGlCUBZIdX3utfQL KAhoYMdp22jST/UWLY0bANWDaFFSxk/QA7LvGShb+IlpjvuG3jP/Ll4Y7Ofkvpu04yG5tj ovOirc8KFRcGOFYcGao+cMFmWwaLbBWP4LjGz/o25cWQlAAIAoirOowi+M2bwQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4jZYKS1KKmzkbH for ; Wed, 25 Nov 2026 21:51:24 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 15383 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Wed, 25 Nov 2026 21:51:24 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Devin Teske Subject: git: 90866c753c63 - main - sysrc: Improve die() function List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all X-BeenThere: dev-commits-src-all@freebsd.org List-Id: Commit messages for all branches of the src repository List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dteske X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 90866c753c63ffd8a483f25f1015f4c6d65506a1 Auto-Submitted: auto-generated Date: Wed, 25 Nov 2026 21:51:24 +0000 Message-Id: <6b07585c.15383.2ce1558a@gitrepo.freebsd.org> The branch main has been updated by dteske: URL: https://cgit.FreeBSD.org/src/commit/?id=90866c753c63ffd8a483f25f1015f4c6d65506a1 commit 90866c753c63ffd8a483f25f1015f4c6d65506a1 Author: Devin Teske AuthorDate: 2026-11-25 21:45:15 +0000 Commit: Devin Teske CommitDate: 2026-11-25 21:47:37 +0000 sysrc: Improve die() function Reviewed by: kfv Differential Revision: https://reviews.freebsd.org/D61721 --- usr.sbin/sysrc/sysrc | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/usr.sbin/sysrc/sysrc b/usr.sbin/sysrc/sysrc index a02538901136..0fc2e9ec872e 100644 --- a/usr.sbin/sysrc/sysrc +++ b/usr.sbin/sysrc/sysrc @@ -16,7 +16,7 @@ pgm="${0##*/}" # Program basename # # Version information # -SYSRC_VERSION="8.4 Nov-18,2026" +SYSRC_VERSION="8.5 Nov-18,2026" # # Options @@ -50,9 +50,11 @@ VERBOSE= # -v die() { local fmt="$1" - [ $# -gt 0 ] && shift 1 - [ "$fmt" ] && f_err "$fmt\n" "$@" + if [ "$fmt" ]; then + shift 1 # fmt + f_err "%s: $fmt\n" "$pgm" "$@" + fi exit $FAILURE } @@ -233,7 +235,7 @@ while getopts AacDdEeFf:hij:LlNnqR:rs:vXx flag; do h) usage ;; # NOTREACHED i) IGNORE_UNKNOWNS=1 ;; j) [ "$OPTARG" ] || - die "%s: Missing or null argument to \`-j' flag" "$pgm" + die "Missing or null argument to \`-j' flag" JAIL="$OPTARG" ;; L) LIST_SERVICE_CONFS=1 ;; l) LIST_CONFS=1 ;; @@ -241,11 +243,11 @@ while getopts AacDdEeFf:hij:LlNnqR:rs:vXx flag; do n) SHOW_NAME= ;; q) QUIET=1 VERBOSE= ;; R) [ "$OPTARG" ] || - die "%s: Missing or null argument to \`-R' flag" "$pgm" + die "Missing or null argument to \`-R' flag" ROOTDIR="$OPTARG" ;; r) RAW=1 ;; s) [ "$OPTARG" ] || - die "%s: Missing or null argument to \`-s' flag" "$pgm" + die "Missing or null argument to \`-s' flag" SERVICE="$OPTARG" ;; v) VERBOSE=1 QUIET= ;; X) DELETE=2 ;; @@ -334,9 +336,8 @@ for name in "$@"; do name="${name%%:[+=-]*}" name="${name%%.=*}" # string append name="${name%%[%#+=-]*}" - [ "$name" = "${name#*[!$VALID_VARNAME_CHARS]}" ] || die \ - "%s: %s: name contains characters not allowed in shell" \ - "$pgm" "$name" + [ "$name" = "${name#*[!$VALID_VARNAME_CHARS]}" ] || + die "%s: name contains characters not allowed in shell" "$name" done # @@ -399,7 +400,7 @@ fi # # Taint-check all rc.conf(5) files # -errmsg="$pgm: Exiting due to previous syntax errors" +errmsg="Exiting due to previous syntax errors" if [ "${RC_CONFS+set}" ]; then ( for i in $RC_CONFS; do [ -e "$i" ] || continue @@ -421,7 +422,7 @@ fi # # Process `-x' (and secret `-X') command-line options # -errmsg="$pgm: \`-x' option incompatible with \`-a'/\`-A' options" +errmsg="\`-x' option incompatible with \`-a'/\`-A' options" errmsg="$errmsg (use \`-X' to override)" if [ "$DELETE" -a "$SHOW_ALL" ]; then [ "$DELETE" = "2" ] || die "$errmsg" @@ -431,7 +432,7 @@ fi # Pre-flight for `-c' command-line option # [ "$CHECK_ONLY" -a "$SHOW_ALL" ] && - die "$pgm: \`-c' option incompatible with \`-a'/\`-A' options" + die "\`-c' option incompatible with \`-a'/\`-A' options" # # Process `-e', `-N', and `-n' command-line options @@ -524,7 +525,7 @@ if [ "$JAIL" -o "$ROOTDIR" ]; then # directory, exit with error. # if [ "$jid" -a "${jid%[$IFS]*}" != "$jid" ]; then - die "%s: %s: %s" "$pgm" "$ROOTDIR" \ + die "%s: %s" "$ROOTDIR" \ "$( echo "Multiple jails claim this" \ "directory as their root." \ "(use \`-j jail' instead)" )"