Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 8 Oct 2015 00:52:07 +0200
From:      Baptiste Daroussin <bapt@freebsd.org>
To:        NGie Cooper <yaneurabeya@gmail.com>
Cc:        "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org>, Conrad Meyer <cem@freebsd.org>
Subject:   Re: svn commit: r288984 - head/sbin/sysctl
Message-ID:  <20151007225207.GG91729@ivaldir.etoilebsd.net>
In-Reply-To: <CAGHfRMBV7%2BECQshL=F8XuASQDNr1FSwFix2aDd5cOa4ecF0yRQ@mail.gmail.com>
References:  <201510070928.t979SsMQ057994@repo.freebsd.org> <CAG6CVpVdOeUFg3cSffTKcn9T2SGvLMhERiesecwZ6aoeAjpLjA@mail.gmail.com> <20151007223533.GF91729@ivaldir.etoilebsd.net> <CAGHfRMBV7%2BECQshL=F8XuASQDNr1FSwFix2aDd5cOa4ecF0yRQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--reI/iBAAp9kzkmX4
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

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@freebsd.org> wro=
te:
> ...
> > I do not think it is, but I couldn't find a way to reproduce another ca=
se than
> > ENOENT, so I thought maybe the best would be to keep the current behavi=
our for
> > other cases :)
>=20
> Can't hit ENOTDIR:
>=20
> # sysctl kern=3Direallyshouldnotbedoingthis
> sysctl: oid 'kern' isn't a leaf node

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

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

Same
>=20
> Not sure how to hit EINVAL, other than maybe try and read a sysctl
> that dynamically populates itself (this might trigger ENOMEM errors
> though):
>=20
> # sysctl kern.i.am.a.fun.oid.or.something.like.that.yadda.yadda=3D1000
> 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
>=20
> FWIW I think Conrad's right though about fixing the message to be more
> meaningful in the errno !=3D ENOENT case though.

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

Bapt

--reI/iBAAp9kzkmX4
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlYVohcACgkQ8kTtMUmk6Ew70ACgwfncW2+vSmxZnLvB+frqj3Ze
BPwAoID9I0a9byDu8uSfLk3zms1ZOZOq
=qPxd
-----END PGP SIGNATURE-----

--reI/iBAAp9kzkmX4--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20151007225207.GG91729>