43fe83
From 77741a2a22befeb1fb09057b502c950e4faea78a Mon Sep 17 00:00:00 2001
43fe83
Message-Id: <77741a2a22befeb1fb09057b502c950e4faea78a.1381871412.git.jdenemar@redhat.com>
43fe83
From: "Daniel P. Berrange" <berrange@redhat.com>
43fe83
Date: Mon, 14 Oct 2013 16:45:21 +0100
43fe83
Subject: [PATCH] Fix exit status of lxc controller
43fe83
43fe83
For
43fe83
43fe83
  https://bugzilla.redhat.com/show_bug.cgi?id=927072
43fe83
43fe83
The LXC controller main() method initialized 'rc' to 1
43fe83
rather than '-1'. In the cleanup path it will print any
43fe83
error to stderr, if-and-only-if rc < 0. Hence the incorrect
43fe83
initialization caused errors to be lost.
43fe83
43fe83
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
43fe83
(cherry picked from commit 13c011c3373ec4edaee188d749d032102503c9ea)
43fe83
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
43fe83
---
43fe83
 src/lxc/lxc_controller.c | 2 +-
43fe83
 1 file changed, 1 insertion(+), 1 deletion(-)
43fe83
43fe83
diff --git a/src/lxc/lxc_controller.c b/src/lxc/lxc_controller.c
43fe83
index 5802851..e301c43 100644
43fe83
--- a/src/lxc/lxc_controller.c
43fe83
+++ b/src/lxc/lxc_controller.c
43fe83
@@ -2230,7 +2230,7 @@ cleanup:
43fe83
 int main(int argc, char *argv[])
43fe83
 {
43fe83
     pid_t pid;
43fe83
-    int rc = 1;
43fe83
+    int rc = -1;
43fe83
     char *name = NULL;
43fe83
     size_t nveths = 0;
43fe83
     char **veths = NULL;
43fe83
-- 
43fe83
1.8.3.2
43fe83