docs/63198: sysctl_ctx_init.9 example code: 'name' parameters not quoted

Bruce Cran bruce at cran.org.uk
Sun Feb 22 00:50:34 UTC 2004


>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:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          doc-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 21 16:50:33 PST 2004
>Closed-Date:
>Last-Modified:
>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 at 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:
>Unformatted:



More information about the freebsd-doc mailing list