Date: Tue, 28 Jan 2025 15:23:14 GMT From: Zhenlei Huang <zlei@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 719fb5a37731 - stable/14 - kern_sysctl: Fix printing function name in the re-use sysctl leaf warning Message-ID: <202501281523.50SFNEIb070844@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=719fb5a37731f6e69f2ba2b67fb3e19f2f007100 commit 719fb5a37731f6e69f2ba2b67fb3e19f2f007100 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:22:15 +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) --- 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 9f340404f9b3..3d66de0b18bb 100644 --- a/sys/kern/kern_sysctl.c +++ b/sys/kern/kern_sysctl.c @@ -413,7 +413,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); rc = sysctl_search_oid(nodes, leaf); if (rc > 0) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202501281523.50SFNEIb070844>