render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
Blob Blame History Raw
From 77741a2a22befeb1fb09057b502c950e4faea78a Mon Sep 17 00:00:00 2001
Message-Id: <77741a2a22befeb1fb09057b502c950e4faea78a.1381871412.git.jdenemar@redhat.com>
From: "Daniel P. Berrange" <berrange@redhat.com>
Date: Mon, 14 Oct 2013 16:45:21 +0100
Subject: [PATCH] Fix exit status of lxc controller

For

  https://bugzilla.redhat.com/show_bug.cgi?id=927072

The LXC controller main() method initialized 'rc' to 1
rather than '-1'. In the cleanup path it will print any
error to stderr, if-and-only-if rc < 0. Hence the incorrect
initialization caused errors to be lost.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
(cherry picked from commit 13c011c3373ec4edaee188d749d032102503c9ea)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
 src/lxc/lxc_controller.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
index 5802851..e301c43 100644
--- a/src/lxc/lxc_controller.c
+++ b/src/lxc/lxc_controller.c
@@ -2230,7 +2230,7 @@ cleanup:
 int main(int argc, char *argv[])
 {
     pid_t pid;
-    int rc = 1;
+    int rc = -1;
     char *name = NULL;
     size_t nveths = 0;
     char **veths = NULL;
-- 
1.8.3.2