Commit e8e17902 authored by Kevin Bracey's avatar Kevin Bracey
Browse files

Made sure no output with -e flag

parent 93610c03
...@@ -63,6 +63,7 @@ static const char rcsid[] = ...@@ -63,6 +63,7 @@ static const char rcsid[] =
#include <unixlib.h> #include <unixlib.h>
#include <riscos.h> #include <riscos.h>
char *__progname = "SysCtl"; char *__progname = "SysCtl";
static int errvarflag;
#endif #endif
static int Aflag, aflag, bflag, dflag, nflag, wflag, Xflag; static int Aflag, aflag, bflag, dflag, nflag, wflag, Xflag;
...@@ -107,7 +108,7 @@ main(int argc, char **argv) ...@@ -107,7 +108,7 @@ main(int argc, char **argv)
case 'w': wflag = 1; break; case 'w': wflag = 1; break;
case 'X': Xflag = Aflag = 1; break; case 'X': Xflag = Aflag = 1; break;
#ifdef __riscos #ifdef __riscos
case 'e': err_set_silent(1); break; case 'e': err_set_silent(1); errvarflag = 1; break;
#endif #endif
default: usage(); default: usage();
} }
...@@ -209,8 +210,14 @@ parse(char *string) ...@@ -209,8 +210,14 @@ parse(char *string)
kind & CTLTYPE); kind & CTLTYPE);
} }
#ifdef __riscos
if (!errvarflag)
#endif
i = show_var(mib, len); i = show_var(mib, len);
if (sysctl(mib, len, 0, 0, newval, newsize) == -1) { if (sysctl(mib, len, 0, 0, newval, newsize) == -1) {
#ifdef __riscos
if (!errvarflag)
#endif
if (!i && !bflag) if (!i && !bflag)
putchar('\n'); putchar('\n');
switch (errno) { switch (errno) {
...@@ -228,13 +235,22 @@ parse(char *string) ...@@ -228,13 +235,22 @@ parse(char *string)
return; return;
} }
} }
#ifdef __riscos
if (!errvarflag)
#endif
if (!bflag) if (!bflag)
printf(" -> "); printf(" -> ");
i = nflag; i = nflag;
nflag = 1; nflag = 1;
#ifdef __riscos
if (!errvarflag) {
#endif
j = show_var(mib, len); j = show_var(mib, len);
if (!j && !bflag) if (!j && !bflag)
putchar('\n'); putchar('\n');
#ifdef __riscos
}
#endif
nflag = i; nflag = i;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment