svn commit: r306580 - head/lib/libjail

Ruslan Bukin br at FreeBSD.org
Sun Oct 2 11:56:19 UTC 2016


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. */


More information about the svn-src-head mailing list