From 77858bf69abce28fb6b349ba7c533e6f8d6537f7 Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Tue, 8 Apr 2014 14:26:26 +0200 Subject: [PATCH] LXC: Fix return code evaulation in lxcCheckNetNsSupport() Commit b9dd878f (util: make it easier to grab only regular command exit) changed the call semantics of virCommandRun() and therefore of virRun() too. But lxcCheckNetNsSupport() was not updated. As consequence of this lxcCheckNetNsSupport always failed and broke LXC. Signed-off-by: Richard Weinberger --- src/lxc/lxc_driver.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c index 05464cbf20..6b117665d3 100644 --- a/src/lxc/lxc_driver.c +++ b/src/lxc/lxc_driver.c @@ -1475,8 +1475,7 @@ static int lxcCheckNetNsSupport(void) const char *argv[] = {"ip", "link", "set", "lo", "netns", "-1", NULL}; int ip_rc; - if (virRun(argv, &ip_rc) < 0 || - !(WIFEXITED(ip_rc) && (WEXITSTATUS(ip_rc) != 255))) + if (virRun(argv, &ip_rc) < 0 || ip_rc == 255) return 0; if (lxcContainerAvailable(LXC_CONTAINER_FEATURE_NET) < 0) -- 2.47.3