Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Sep 2024 05:02:38 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: d6271b6507b2 - stable/14 - kern: Align the declaration of kernconfstring with its definition
Message-ID:  <202409020502.48252chY024176@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=d6271b6507b2404bd03f21f76a4e8394e083ae80

commit d6271b6507b2404bd03f21f76a4e8394e083ae80
Author:     Zhenlei Huang <zlei@FreeBSD.org>
AuthorDate: 2024-08-22 10:00:34 +0000
Commit:     Zhenlei Huang <zlei@FreeBSD.org>
CommitDate: 2024-09-02 05:01:40 +0000

    kern: Align the declaration of kernconfstring with its definition
    
    It is defined as const char[] in config.c which is auto generated by
    usr.sbin/config/kernconf.tmpl .
    
    While here prefer macro SYSCTL_CONST_STRING to avoid casting.
    
    MFC after:      1 week
    
    (cherry picked from commit 0f64fc6a3486454ad708f517633f930e611fd6d2)
---
 sys/kern/kern_mib.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sys/kern/kern_mib.c b/sys/kern/kern_mib.c
index 8ce09a47ef58..10bf4cde6489 100644
--- a/sys/kern/kern_mib.c
+++ b/sys/kern/kern_mib.c
@@ -460,10 +460,10 @@ SYSCTL_PROC(_kern, KERN_SECURELVL, securelevel,
 
 #ifdef INCLUDE_CONFIG_FILE
 /* Actual kernel configuration options. */
-extern char kernconfstring[];
+extern const char kernconfstring[];
 
-SYSCTL_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD,
-    kernconfstring, 0, "Kernel configuration file");
+SYSCTL_CONST_STRING(_kern, OID_AUTO, conftxt, CTLFLAG_RD,
+    kernconfstring, "Kernel configuration file");
 #endif
 
 static int



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202409020502.48252chY024176>