Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/sysctl Do nothing else for nodes with no children if -d...



details:   https://anonhg.NetBSD.org/src/rev/7ed5b3694042
branches:  trunk
changeset: 565424:7ed5b3694042
user:      atatat <atatat%NetBSD.org@localhost>
date:      Thu Apr 08 04:00:33 2004 +0000

description:
Do nothing else for nodes with no children if -d is used (dflag is
set).  Otherwise, some nodes (those with "printers") will also print
the "use foo ..." message.

diffstat:

 sbin/sysctl/sysctl.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r 79b84dcef389 -r 7ed5b3694042 sbin/sysctl/sysctl.c
--- a/sbin/sysctl/sysctl.c      Thu Apr 08 03:57:48 2004 +0000
+++ b/sbin/sysctl/sysctl.c      Thu Apr 08 04:00:33 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sysctl.c,v 1.87 2004/04/06 19:39:44 atatat Exp $ */
+/*     $NetBSD: sysctl.c,v 1.88 2004/04/08 04:00:33 atatat Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -72,7 +72,7 @@
 #if 0
 static char sccsid[] = "@(#)sysctl.c   8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: sysctl.c,v 1.87 2004/04/06 19:39:44 atatat Exp $");
+__RCSID("$NetBSD: sysctl.c,v 1.88 2004/04/08 04:00:33 atatat Exp $");
 #endif
 #endif /* not lint */
 
@@ -607,10 +607,12 @@
                __learn_tree(name, namelen, pnode);
                node = pnode->sysctl_child;
                if (node == NULL) {
-                       if (p != NULL)
+                       if (dflag)
+                               /* do nothing */;
+                       else if (p != NULL)
                                (*p->ps_p)(gsname, gdname, NULL, name, namelen,
                                           pnode, type, p->ps_d);
-                       else if ((Aflag || req) && !Mflag && !dflag)
+                       else if ((Aflag || req) && !Mflag)
                                printf("%s: no children\n", gsname);
                }
                else {



Home | Main Index | Thread Index | Old Index