svn commit: r214837 - stable/7/share/man/man9

John Baldwin jhb at FreeBSD.org
Fri Nov 5 13:45:26 UTC 2010


Author: jhb
Date: Fri Nov  5 13:45:26 2010
New Revision: 214837
URL: http://svn.freebsd.org/changeset/base/214837

Log:
  MFC 214673: Fix a few typos and style nits in the example code.

Modified:
  stable/7/share/man/man9/sysctl_ctx_init.9
Directory Properties:
  stable/7/share/man/man9/   (props changed)

Modified: stable/7/share/man/man9/sysctl_ctx_init.9
==============================================================================
--- stable/7/share/man/man9/sysctl_ctx_init.9	Fri Nov  5 13:45:13 2010	(r214836)
+++ stable/7/share/man/man9/sysctl_ctx_init.9	Fri Nov  5 13:45:26 2010	(r214837)
@@ -188,27 +188,27 @@ This example uses contexts to keep track
 struct sysctl_ctx_list clist;
 struct sysctl_oid *oidp;
 int a_int;
-char *string = "dynamic sysctl";
+const char *string = "dynamic sysctl";
  ...
 
 sysctl_ctx_init(&clist);
-oidp = SYSCTL_ADD_NODE( &clist, SYSCTL_STATIC_CHILDREN(/* tree top */),
-	OID_AUTO, "newtree", CTFLAG_RW, 0, "new top level tree");
-oidp = SYSCTL_ADD_INT( &clist, SYSCTL_CHILDREN(oidp),
+oidp = SYSCTL_ADD_NODE(&clist, SYSCTL_STATIC_CHILDREN(/* tree top */),
+	OID_AUTO, "newtree", CTLFLAG_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");
  ...
-oidp = SYSCTL_ADD_NODE( &clist, SYSCTL_STATIC_CHILDREN(_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");
+oidp = SYSCTL_ADD_NODE(&clist, SYSCTL_STATIC_CHILDREN(_debug),
+	OID_AUTO, "newtree", CTLFLAG_RW, 0, "new tree under debug");
+oidp = SYSCTL_ADD_STRING(&clist, SYSCTL_CHILDREN(oidp),
+	OID_AUTO, "newstring", CTLFLAG_RD, string, 0, "new string leaf");
  ...
 /* Now we can free up the oids */
-if(sysctl_ctx_free(&clist)) {
+if (sysctl_ctx_free(&clist)) {
 	printf("can't free this context - other oids depend on it");
-	return(ENOTEMPTY);
+	return (ENOTEMPTY);
 } else {
-	printf("Success!\\n"):
-	return(0);
+	printf("Success!\\n");
+	return (0);
 }
 .Ed
 .Pp


More information about the svn-src-all mailing list