aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2026-06-26 14:38:58 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2026-06-26 14:38:58 +0000
commitb0d3a2889a1b8e4b73ad1f396884224e1442b214 (patch)
treeb48d530588e3ab557811a76e4b7358c0f041e10c
parenta71abf38e2b46c02965f3224c62bb6ef1971996e (diff)
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
-rwxr-xr-xlibexec/rc/rc.d/ddb4
1 files 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
}