Date: Wed, 7 Oct 2015 15:45:10 -0700 From: Bryan Drewery <bdrewery@FreeBSD.org> To: NGie Cooper <yaneurabeya@gmail.com>, Baptiste Daroussin <bapt@freebsd.org> Cc: Conrad Meyer <cem@freebsd.org>, "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> Subject: Re: svn commit: r288984 - head/sbin/sysctl Message-ID: <5615A076.9010403@FreeBSD.org> 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
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --BxuM2UdJHdL1wsTCVbLBgfSlo8C8ED4lH Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 10/7/2015 3:41 PM, NGie Cooper wrote: > On Wed, Oct 7, 2015 at 3:35 PM, Baptiste Daroussin <bapt@freebsd.org> w= rote: > ... >> I do not think it is, but I couldn't find a way to reproduce another c= ase than >> ENOENT, so I thought maybe the best would be to keep the current behav= iour for >> other cases :) >=20 Here's the relevant code: sys/kern/kern_sysctl.c:SYSCTL_PROC(_sysctl, 3, name2oid =2E.. static SYSCTL_NODE(_sysctl, 2, next, CTLFLAG_RD | CTLFLAG_MPSAFE | CTLFLAG_CAPRD, sysctl_sysctl_next, ""); static int name2oid(char *name, int *oid, int *len, struct sysctl_oid **oidpp) { struct sysctl_oid *oidp; struct sysctl_oid_list *lsp =3D &sysctl__children; char *p; SYSCTL_ASSERT_LOCKED(); for (*len =3D 0; *len < CTL_MAXNAME;) { p =3D strsep(&name, "."); oidp =3D SLIST_FIRST(lsp); for (;; oidp =3D SLIST_NEXT(oidp, oid_link)) { if (oidp =3D=3D NULL) return (ENOENT); if (strcmp(p, oidp->oid_name) =3D=3D 0) break; } *oid++ =3D oidp->oid_number; (*len)++; if (name =3D=3D NULL || *name =3D=3D '\0') { if (oidpp) *oidpp =3D oidp; return (0); } if ((oidp->oid_kind & CTLTYPE) !=3D CTLTYPE_NODE) break; if (oidp->oid_handler) break; lsp =3D SYSCTL_CHILDREN(oidp); } return (ENOENT); } It can only return 0 or ENOENT. --=20 Regards, Bryan Drewery --BxuM2UdJHdL1wsTCVbLBgfSlo8C8ED4lH Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJWFaB2AAoJEDXXcbtuRpfP0cUIAJBG1opVCr9WWRp2kEbOecUa vUj32Fm40Sq8N3L7M4T8k10z6jxGCjrXO+2C5Lilr963hxec8k4EGZwt0ek1udWf Lv7gxigbvpL0SX9WGTCNUpj47cXR+B5s7AJm2R6Fa1v5UxCOI+Z1NPpQ+YSDqMtk vnRjVlHf9Vwg11Z+jI9zgKn8Ylahot6xtXC4FL71MXNqz4BitEQc0TbKv0Itf4+r QORs+9PdDccjBSKfe47b9WztCWxD3nu1G/HvWM+2k/oZeN3101zb1DlrlCRXueVi JY2RuEve4dVknsC0JaL6DX8U0ICCkUD/fL10vWby5jpCRFHE66r8cuWN9bVxdsY= =2FhS -----END PGP SIGNATURE----- --BxuM2UdJHdL1wsTCVbLBgfSlo8C8ED4lH--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5615A076.9010403>