[libvirt] [PATCH] lxc: report correct error

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 | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index e905302..b94941d 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -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; } -- 1.7.4.4

On 05/03/2011 05:04 PM, Eric Blake wrote:
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 | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index e905302..b94941d 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -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; }
ACK.

On 05/03/2011 10:48 PM, Laine Stump wrote:
On 05/03/2011 05:04 PM, Eric Blake wrote:
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.
ACK.
Thanks; pushed. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org
participants (2)
-
Eric Blake
-
Laine Stump