git: b0d3a2889a1b - main - rc.d/ddb: Really silently exit
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 26 Jun 2026 14:40:16 UTC
The branch main has been updated by des:
URL: https://cgit.FreeBSD.org/src/commit/?id=b0d3a2889a1b8e4b73ad1f396884224e1442b214
commit b0d3a2889a1b8e4b73ad1f396884224e1442b214
Author: Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-06-26 14:38:58 +0000
Commit: Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-06-26 14:38:58 +0000
rc.d/ddb: Really silently exit
The comment says “silently exit if ddb is not enabled”, but we'd exit
with an error message.
Note that I switched the sysctl variable used to test for the presence
of ddb from debug.ddb.scripting.scripts to d.d.s.script, which has a
smaller value if set.
While here, drop a pointless fork-exec, and use ${SYSCTL_N} for
consistency.
PR: 177217
MFC after: 1 week
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D57686
---
libexec/rc/rc.d/ddb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libexec/rc/rc.d/ddb b/libexec/rc/rc.d/ddb
index 08a7d345c326..a30df2dc1c5e 100755
--- a/libexec/rc/rc.d/ddb
+++ b/libexec/rc/rc.d/ddb
@@ -20,8 +20,8 @@ stop_cmd=":"
ddb_prestart()
{
# Silently exit if ddb is not enabled
- if [ -z "`sysctl -Nq debug.ddb.scripting.scripts`" ]; then
- return 1
+ if ! ${SYSCTL_N} -q debug.ddb.scripting.script >/dev/null; then
+ exit 1
fi
}