From owner-svn-src-all@freebsd.org Wed Oct 7 22:45:15 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E89499D1A70; Wed, 7 Oct 2015 22:45:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id CB124F18; Wed, 7 Oct 2015 22:45:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id C40821620; Wed, 7 Oct 2015 22:45:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 5C2AE1508B; Wed, 7 Oct 2015 22:45:14 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id GFbqTP8whPtO; Wed, 7 Oct 2015 22:45:11 +0000 (UTC) Subject: Re: svn commit: r288984 - head/sbin/sysctl DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 3543A15086 To: NGie Cooper , Baptiste Daroussin References: <201510070928.t979SsMQ057994@repo.freebsd.org> <20151007223533.GF91729@ivaldir.etoilebsd.net> Cc: Conrad Meyer , "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <5615A076.9010403@FreeBSD.org> Date: Wed, 7 Oct 2015 15:45:10 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BxuM2UdJHdL1wsTCVbLBgfSlo8C8ED4lH" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Oct 2015 22:45:15 -0000 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 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--