From 2d730c265eb3b77cdb32db02ba2d2e869cdeaa9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Mon, 22 Nov 1999 08:38:29 +0000 Subject: [PATCH] Belatedly back out rev. 1.20. --- sbin/sysctl/sysctl.8 | 7 ++----- sbin/sysctl/sysctl.c | 27 +++++++-------------------- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/sbin/sysctl/sysctl.8 b/sbin/sysctl/sysctl.8 index 599e36f07874..611637ab937e 100644 --- a/sbin/sysctl/sysctl.8 +++ b/sbin/sysctl/sysctl.8 @@ -40,14 +40,14 @@ .Nd get or set kernel state .Sh SYNOPSIS .Nm sysctl -.Op Fl bdn +.Op Fl bn .Ar name ... .Nm sysctl .Op Fl bn .Fl w .Ar name=value ... .Nm sysctl -.Op Fl bdn +.Op Fl bn .Fl aAX .Sh DESCRIPTION The @@ -85,9 +85,6 @@ set psize=`sysctl -n hw.pagesize` Force the value of the variable(s) to be output in raw, binary format. No names are printed and no terminating newlines are output. This is mostly useful with a single variable. -.It Fl d -Display the description rather than the value of the requested -variable(s). .It Fl w Ar name=value ... Set the MIB .Ar name diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 5b5672c16a46..fb7c30585945 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -58,7 +58,7 @@ static const char rcsid[] = #include #include -static int Aflag, aflag, bflag, dflag, nflag, wflag, Xflag; +static int Aflag, aflag, bflag, nflag, wflag, Xflag; static int oidfmt(int *, int, char *, u_int *); static void parse(char *); @@ -71,11 +71,11 @@ usage(void) { (void)fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", - "usage: sysctl [-bdn] variable ...", + "usage: sysctl [-bn] variable ...", " sysctl [-bn] -w variable=value ...", - " sysctl [-bdn] -a", - " sysctl [-bdn] -A", - " sysctl [-bdn] -X"); + " sysctl [-bn] -a", + " sysctl [-bn] -A", + " sysctl [-bn] -X"); exit(1); } @@ -86,12 +86,11 @@ main(int argc, char **argv) setbuf(stdout,0); setbuf(stderr,0); - while ((ch = getopt(argc, argv, "AabdnwX")) != -1) { + while ((ch = getopt(argc, argv, "AabnwX")) != -1) { switch (ch) { case 'A': Aflag = 1; break; case 'a': aflag = 1; break; case 'b': bflag = 1; break; - case 'd': dflag = 1; break; case 'n': nflag = 1; break; case 'w': wflag = 1; break; case 'X': Xflag = Aflag = 1; break; @@ -101,7 +100,7 @@ main(int argc, char **argv) argc -= optind; argv += optind; - if (wflag && (Aflag || aflag || dflag)) + if (wflag && (Aflag || aflag)) usage(); if (Aflag || aflag) exit (sysctl_all(0, 0)); @@ -356,18 +355,6 @@ show_var(int *oid, int nlen) if (i || !j) err(1, "sysctl name %d %d %d", i, j, errno); - if (dflag) { - qoid[1] = 5; - j = sizeof descr; - i = sysctl(qoid, nlen + 2, descr, &j, 0, 0); - if (i || !j) - err(1, "sysctl name %d %d %d", i, j, errno); - if (!nflag) - printf("%s: ", name); - printf("%s", descr[0] ? descr : "[no description]"); - return (0); - } - /* find an estimate of how much we need for this var */ j = 0; i = sysctl(oid, nlen, 0, &j, 0, 0);