Fix: do not overwrite ret if already set and session found
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 13 Sep 2016 21:17:50 +0000 (17:17 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 7 Oct 2016 21:18:45 +0000 (17:18 -0400)
Errors were not propagated correctly otherwise.

e.g:
(No sessiond running)
lttng load --all
-> All sessions have been loaded successfully
lttng list show no sessions

With fix the same command output:
Error: No session daemon is available

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/config/session-config.c

index 6c639af440143ab00d31631257a311b51160f8f6..503f49fad8ce441586e4473c01ca6bd9de488c0e 100644 (file)
@@ -2842,7 +2842,7 @@ end:
                }
        }
 
-       if (session_found) {
+       if (session_found && !ret) {
                ret = 0;
        }
 
This page took 0.027353 seconds and 4 git commands to generate.