summaryrefslogtreecommitdiff
path: root/sbin/sysctl/sysctl.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2007-11-26 13:36:35 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2007-11-26 13:36:35 +0000
commit8a978ed56b75a0f4fd0602dbe656a827baeedc14 (patch)
tree10724ed6fd520333d88f6bc187fc477addb97a86 /sbin/sysctl/sysctl.c
parentb2e70517f47cbe6832a7f91cc516866c53bc2760 (diff)
if no arguments given, assume a nice default; ok miod jakemsr deanna
Diffstat (limited to 'sbin/sysctl/sysctl.c')
-rw-r--r--sbin/sysctl/sysctl.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c
index d5f17bcbb52..62892805803 100644
--- a/sbin/sysctl/sysctl.c
+++ b/sbin/sysctl/sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysctl.c,v 1.150 2007/11/11 15:48:35 jmc Exp $ */
+/* $OpenBSD: sysctl.c,v 1.151 2007/11/26 13:36:33 deraadt Exp $ */
/* $NetBSD: sysctl.c,v 1.9 1995/09/30 07:12:50 thorpej Exp $ */
/*
@@ -40,7 +40,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)sysctl.c 8.5 (Berkeley) 5/9/95";
#else
-static const char rcsid[] = "$OpenBSD: sysctl.c,v 1.150 2007/11/11 15:48:35 jmc Exp $";
+static const char rcsid[] = "$OpenBSD: sysctl.c,v 1.151 2007/11/26 13:36:33 deraadt Exp $";
#endif
#endif /* not lint */
@@ -252,15 +252,13 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
- if (argc == 0 && (Aflag || aflag)) {
+ if (argc == 0 || (Aflag || aflag)) {
debuginit();
vfsinit();
for (lvl1 = 1; lvl1 < CTL_MAXID; lvl1++)
listall(topname[lvl1].ctl_name, &secondlevel[lvl1]);
return (0);
}
- if (argc == 0)
- usage();
for (; *argv != NULL; ++argv)
parse(*argv, 1);
return (0);
@@ -2427,6 +2425,6 @@ usage(void)
(void)fprintf(stderr, "usage:\t%s\n\t%s\n\t%s\n",
"sysctl [-n] name ...", "sysctl [-nq] name=value ...",
- "sysctl [-n] -Aa");
+ "sysctl [-Aan]");
exit(1);
}