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[] =
#include <unixlib.h>
#include <riscos.h>
char *__progname = "SysCtl";
static int errvarflag;
#endif
static int Aflag, aflag, bflag, dflag, nflag, wflag, Xflag;
......@@ -107,7 +108,7 @@ main(int argc, char **argv)
case 'w': wflag = 1; break;
case 'X': Xflag = Aflag = 1; break;
#ifdef __riscos
case 'e': err_set_silent(1); break;
case 'e': err_set_silent(1); errvarflag = 1; break;
#endif
default: usage();
}
......@@ -209,8 +210,14 @@ parse(char *string)
kind & CTLTYPE);
}
#ifdef __riscos
if (!errvarflag)
#endif
i = show_var(mib, len);
if (sysctl(mib, len, 0, 0, newval, newsize) == -1) {
#ifdef __riscos
if (!errvarflag)
#endif
if (!i && !bflag)
putchar('\n');
switch (errno) {
......@@ -228,13 +235,22 @@ parse(char *string)
return;
}
}
#ifdef __riscos
if (!errvarflag)
#endif
if (!bflag)
printf(" -> ");
i = nflag;
nflag = 1;
#ifdef __riscos
if (!errvarflag) {
#endif
j = show_var(mib, len);
if (!j && !bflag)
putchar('\n');
#ifdef __riscos
}
#endif
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