From bruce@cran.org.uk  Sat Feb 21 16:41:25 2004
Return-Path: <bruce@cran.org.uk>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id E996B16A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 21 Feb 2004 16:41:25 -0800 (PST)
Received: from mta5-svc.business.ntl.com (mta5-svc.business.ntl.com [62.253.164.45])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7863D43D1D
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 21 Feb 2004 16:41:25 -0800 (PST)
	(envelope-from bruce@cran.org.uk)
Received: from box1.cran ([82.2.140.60]) by mta5-svc.business.ntl.com
          (InterMail vM.4.01.03.37 201-229-121-137-20020806) with ESMTP
          id <20040222004124.ERPA16572.mta5-svc.business.ntl.com@box1.cran>
          for <FreeBSD-gnats-submit@freebsd.org>;
          Sun, 22 Feb 2004 00:41:24 +0000
Received: from box1.cran (localhost.cran [127.0.0.1])
	by box1.cran (8.12.11/8.12.10) with ESMTP id i1M0f9Cu001057
	for <FreeBSD-gnats-submit@freebsd.org>; Sun, 22 Feb 2004 00:41:09 GMT
	(envelope-from brucec@box1.cran)
Received: (from brucec@localhost)
	by box1.cran (8.12.11/8.12.10/Submit) id i1M0f9oT001056;
	Sun, 22 Feb 2004 00:41:09 GMT
	(envelope-from brucec)
Message-Id: <200402220041.i1M0f9oT001056@box1.cran>
Date: Sun, 22 Feb 2004 00:41:09 GMT
From: Bruce Cran <bruce@cran.org.uk>
Reply-To: Bruce Cran <bruce@cran.org.uk>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: sysctl_ctx_init.9 example code: 'name' parameters not quoted 
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         63198
>Category:       docs
>Synopsis:       sysctl_ctx_init.9 example code: 'name' parameters not quoted
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-doc
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 21 16:50:33 PST 2004
>Closed-Date:    Thu Jun 03 03:21:52 PDT 2004
>Last-Modified:  Thu Jun 03 03:21:52 PDT 2004
>Originator:     Bruce Cran
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
>Environment:
System: FreeBSD box1.cran 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Fri Feb 20 21:31:18 GMT 2004 brucec@box1.cran:/usr/obj/usr/src/sys/MYKERNEL i386

	FreeBSD 5.2-CURRENT
	
>Description:
The sysctl_ctx_init man page has an example which won't compile,
because the newtree, newint and newstring parameters should be strings, but are
used without quotation marks.
	
>How-To-Repeat:
'man sysctl_ctx_init'
	
>Fix:
--- /usr/src/share/man/man9/sysctl_ctx_init.9   Wed Jan  9 11:43:48 2002
+++ sysctl_ctx_init.9   Sun Feb 22 00:35:20 2004
@@ -192,14 +192,14 @@

 sysctl_ctx_init(&clist);
 oidp = SYSCTL_ADD_NODE( &clist, SYSCTL_STATIC_CHILDREN(/* tree top */),
-       OID_AUTO, newtree, CTFLAG_RW, 0, "new top level tree");
+       OID_AUTO, "newtree", CTFLAG_RW, 0, "new top level tree");
 oidp = SYSCTL_ADD_INT( &clist, SYSCTL_CHILDREN(oidp),
-       OID_AUTO, newint, CTLFLAG_RW, &a_int, 0, "new int leaf");
+       OID_AUTO, "newint", CTLFLAG_RW, &a_int, 0, "new int leaf");
  ...
 oidp = SYSCTL_ADD_NODE( &clist, SYSCTL_STATIC_CHILDREN(_debug),
-       OID_AUTO, newtree, CTFLAG_RW, 0, "new tree under debug");
+       OID_AUTO, "newtree", CTFLAG_RW, 0, "new tree under debug");
 oidp = SYSCTL_ADD_STRING( &clist, SYSCTL_CHILDREN(oidp),
-       OID_AUTO, newstring, CTLFLAG_R, string, 0, "new string leaf");
+       OID_AUTO, "newstring", CTLFLAG_R, string, 0, "new string leaf");
  ...
 /* Now we can free up the oids */
 if(sysctl_ctx_free(&clist)) {

	


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: roam 
State-Changed-When: Thu Jun 3 03:21:06 PDT 2004 
State-Changed-Why:  
This was actually fixed by Mark Murray in rev. 1.11 of sysctl_ctx_init.9. 
Still, thanks for the problem report! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=63198 
>Unformatted:
