git: 477403117f06 - stable/13 - kern_sysctl: Fix printing function name in the re-use sysctl leaf warning
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 28 Jan 2025 15:27:38 UTC
The branch stable/13 has been updated by zlei:
URL: https://cgit.FreeBSD.org/src/commit/?id=477403117f06ce5b1de006925fc35d1fbec8dc76
commit 477403117f06ce5b1de006925fc35d1fbec8dc76
Author: Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2025-01-25 17:59:33 +0000
Commit: Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2025-01-28 15:26:49 +0000
kern_sysctl: Fix printing function name in the re-use sysctl leaf warning
The helper function sysctl_warn_reuse() is intended to print the name of
the caller rather than that of itself.
PR: 221853
Fixes: 4ae2ade11426 Enhance debugibility of sysctl leaf re-use warnings
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D48645
(cherry picked from commit faa845aab6113190ba8c75a171b2cca8673a6214)
(cherry picked from commit 719fb5a37731f6e69f2ba2b67fb3e19f2f007100)
---
sys/kern/kern_sysctl.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/kern/kern_sysctl.c b/sys/kern/kern_sysctl.c
index dd71b2880ae5..371d521d8850 100644
--- a/sys/kern/kern_sysctl.c
+++ b/sys/kern/kern_sysctl.c
@@ -403,7 +403,7 @@ sysctl_warn_reuse(const char *func, struct sysctl_oid *leaf)
(void)sbuf_new(&sb, buf, sizeof(buf), SBUF_FIXEDLEN | SBUF_INCLUDENUL);
sbuf_set_drain(&sb, sbuf_printf_drain, NULL);
- sbuf_printf(&sb, "%s: can't re-use a leaf (", __func__);
+ sbuf_printf(&sb, "%s: can't re-use a leaf (", func);
memset(nodes, 0, sizeof(nodes));
rc = sysctl_search_oid(nodes, leaf);