Date: Wed, 14 Oct 2015 06:31:49 +0000 (UTC) From: Baptiste Daroussin <bapt@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r289292 - stable/10/sbin/sysctl Message-ID: <201510140631.t9E6VnlY038507@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bapt Date: Wed Oct 14 06:31:49 2015 New Revision: 289292 URL: https://svnweb.freebsd.org/changeset/base/289292 Log: MFC: 288984 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' Sponsored by: Gandi.net Modified: stable/10/sbin/sysctl/sysctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/sysctl/sysctl.c ============================================================================== --- stable/10/sbin/sysctl/sysctl.c Wed Oct 14 06:26:55 2015 (r289291) +++ stable/10/sbin/sysctl/sysctl.c Wed Oct 14 06:31:49 2015 (r289292) @@ -247,7 +247,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); } }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201510140631.t9E6VnlY038507>