Only print the errno string in case sysctl(3) does not file with ENOENT
This reduces the noise in error reporing from sysctl(8): Before: $ sysctl bla=something sysctl: unknown oid 'bla': No such file or directory After: $ sysctl bla=something sysctl: unknown oid 'bla' MFC after: 1 week Sponsored by: Gandi.net
This commit is contained in:
parent
c890751da6
commit
e1619d123e
@ -276,7 +276,11 @@ parse(const char *string, int lineno)
|
||||
if (qflag)
|
||||
return (1);
|
||||
else {
|
||||
warn("unknown oid '%s'%s", bufp, line);
|
||||
if (errno == ENOENT) {
|
||||
warnx("unknown oid '%s'%s", bufp, line);
|
||||
} else {
|
||||
warn("unknown oid '%s'%s", bufp, line);
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user