Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Oct 2016 11:56:17 +0000 (UTC)
From:      Ruslan Bukin <br@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r306580 - head/lib/libjail
Message-ID:  <201610021156.u92BuHso046176@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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. */



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