From owner-svn-src-all@freebsd.org Sun Oct 2 11:56:19 2016 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 3B0FDADAF23; Sun, 2 Oct 2016 11:56:19 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D19571B5; Sun, 2 Oct 2016 11:56:18 +0000 (UTC) (envelope-from br@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u92BuH7r046177; Sun, 2 Oct 2016 11:56:17 GMT (envelope-from br@FreeBSD.org) Received: (from br@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u92BuHso046176; Sun, 2 Oct 2016 11:56:17 GMT (envelope-from br@FreeBSD.org) Message-Id: <201610021156.u92BuHso046176@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: br set sender to br@FreeBSD.org using -f From: Ruslan Bukin Date: Sun, 2 Oct 2016 11:56:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r306580 - head/lib/libjail X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 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: Sun, 02 Oct 2016 11:56:19 -0000 Author: br Date: Sun Oct 2 11:56:17 2016 New Revision: 306580 URL: https://svnweb.freebsd.org/changeset/base/306580 Log: Fix libjail reached latest sysctl entry. Reviewed by: jamie Sponsored by: DARPA, AFRL Sponsored by: HEIF5 Differential Revision: https://reviews.freebsd.org/D8096 Modified: head/lib/libjail/jail.c Modified: head/lib/libjail/jail.c ============================================================================== --- head/lib/libjail/jail.c Sun Oct 2 03:20:31 2016 (r306579) +++ head/lib/libjail/jail.c Sun Oct 2 11:56:17 2016 (r306580) @@ -223,11 +223,16 @@ jailparam_all(struct jailparam **jpp) /* Get the next parameter. */ mlen2 = sizeof(mib2); if (sysctl(mib1, mlen1 + 2, mib2, &mlen2, NULL, 0) < 0) { + if (errno == ENOENT) { + /* No more entries. */ + break; + } snprintf(jail_errmsg, JAIL_ERRMSGLEN, "sysctl(0.2): %s", strerror(errno)); goto error; } - if (mib2[0] != mib1[2] || mib2[1] != mib1[3] || + if (mib2[0] != mib1[2] || + mib2[1] != mib1[3] || mib2[2] != mib1[4]) break; /* Convert it to an ascii name. */