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:21:43 +0000 (17:21 -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/config.c

index f0d38ef92f647c5a81f2eceafbb5240442d7ea6a..d68d5600015d333b7ef68cf72a3712974871d130 100644 (file)
@@ -2750,7 +2750,7 @@ end:
                }
        }
 
-       if (session_found) {
+       if (session_found && !ret) {
                ret = 0;
        }
 
This page took 0.02802 seconds and 4 git commands to generate.