diff options
author | Marko Zec <zec@FreeBSD.org> | 2009-08-21 11:13:56 +0000 |
---|---|---|
committer | Marko Zec <zec@FreeBSD.org> | 2009-08-21 11:13:56 +0000 |
commit | 2b978628436aae61e9bce492dc375e0e47a2152e (patch) | |
tree | df9bfcf1b15b81b12bf7a40d416ac7aedeb9f78f /tools/tools/vimage/vimage.c | |
parent | cd81cd3fd1f57ef36b84e59181b1a29fb77b7936 (diff) | |
download | src-2b978628436aae61e9bce492dc375e0e47a2152e.tar.gz src-2b978628436aae61e9bce492dc375e0e47a2152e.zip |
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)
Notes
Notes:
svn path=/head/; revision=196421
Diffstat (limited to 'tools/tools/vimage/vimage.c')
-rw-r--r-- | tools/tools/vimage/vimage.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tools/tools/vimage/vimage.c b/tools/tools/vimage/vimage.c index b54f9d6224c4..e6655999c50b 100644 --- a/tools/tools/vimage/vimage.c +++ b/tools/tools/vimage/vimage.c @@ -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); |