]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
lxc: report correct error
authorEric Blake <eblake@redhat.com>
Tue, 3 May 2011 20:30:34 +0000 (14:30 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 4 May 2011 15:24:09 +0000 (09:24 -0600)
Clang noticed a dead assignment, which turned out to be the use
of the wrong variable.  rc starts life as -1, and is only ever
assigned to 0 just before a successful cleanup.

* src/lxc/lxc_driver.c (lxcSetupInterfaces): Don't call
virReportSystemError(-1).

src/lxc/lxc_driver.c

index e90530284c41b2da6a656321b940cd0ba9aa0031..b94941d65337790b06cfb0b075c30f5353d3ede0 100644 (file)
@@ -1100,10 +1100,9 @@ static int lxcSetupInterfaces(virConnectPtr conn,
         }
 
         if ((ret = brAddInterface(brctl, bridge, parentVeth)) != 0) {
-            virReportSystemError(rc,
+            virReportSystemError(ret,
                                  _("Failed to add %s device to %s"),
                                  parentVeth, bridge);
-            rc = -1;
             goto error_exit;
         }