Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Aug 2009 11:13:56 +0000 (UTC)
From:      Marko Zec <zec@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r196421 - head/tools/tools/vimage
Message-ID:  <200908211113.n7LBDuco020898@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: zec
Date: Fri Aug 21 11:13:56 2009
New Revision: 196421
URL: http://svn.freebsd.org/changeset/base/196421

Log:
  Bugfix: all requests for creating vnets via vimage -c were always
  reported as failures, even if the actual library / system call
  would succeed, because error message would be reported if the return
  value from jail_setv() call was >= 0, and if not, then if that same
  value was < 0, i.e. always.  The correct behavior is to abort (only)
  if jail_setv() returns < 0.
  
  Approved by:	re (rwatson), julian (mentor)

Modified:
  head/tools/tools/vimage/vimage.c

Modified: head/tools/tools/vimage/vimage.c
==============================================================================
--- head/tools/tools/vimage/vimage.c	Fri Aug 21 10:05:26 2009	(r196420)
+++ head/tools/tools/vimage/vimage.c	Fri Aug 21 11:13:56 2009	(r196421)
@@ -252,7 +252,7 @@ main(int argc, char **argv)
 		exit(0);
 
 	case VI_CREATE:
-		if ((jid = jail_setv(JAIL_CREATE,
+		if (jail_setv(JAIL_CREATE,
 		    "name", argv[0],
 		    "vnet", NULL,
 		    "host", NULL,
@@ -260,9 +260,7 @@ main(int argc, char **argv)
 		    "allow.raw_sockets", "true",
 		    "allow.socket_af", "true",
 		    "allow.mount", "true",
-		    NULL)) >= 0)
-				break;
-		if (jid < 0)
+		    NULL) < 0)
 			break;
 		if (argc == 1)
 			exit(0);



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