svn commit: r288984 - head/sbin/sysctl

Baptiste Daroussin bapt at freebsd.org
Wed Oct 7 22:52:12 UTC 2015


On Wed, Oct 07, 2015 at 03:41:52PM -0700, NGie Cooper wrote:
> On Wed, Oct 7, 2015 at 3:35 PM, Baptiste Daroussin <bapt at freebsd.org> wrote:
> ...
> > I do not think it is, but I couldn't find a way to reproduce another case than
> > ENOENT, so I thought maybe the best would be to keep the current behaviour for
> > other cases :)
> 
> Can't hit ENOTDIR:
> 
> # sysctl kern=ireallyshouldnotbedoingthis
> sysctl: oid 'kern' isn't a leaf node

And this is handle by sysctl(8) and never hit the code I modified

> 
> Can't hit EPERM:
> 
> # sysctl kern.boottime=1000
> sysctl: oid 'kern.boottime' is read only

Same
> 
> Not sure how to hit EINVAL, other than maybe try and read a sysctl
> that dynamically populates itself (this might trigger ENOMEM errors
> though):
> 
> # sysctl kern.i.am.a.fun.oid.or.something.like.that.yadda.yadda=1000
> sysctl: unknown oid
> 'kern.i.am.a.fun.oid.or.something.like.that.yadda.yadda': No such file
> or directory

This is the one I fixed
> 
> FWIW I think Conrad's right though about fixing the message to be more
> meaningful in the errno != ENOENT case though.

So you haven't hit any other case for the code I have modified.

Bapt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20151008/f6fb9dde/attachment.bin>


More information about the svn-src-all mailing list