Fix: Succesful session load might still report an error
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 19 Mar 2014 15:29:18 +0000 (11:29 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Wed, 19 Mar 2014 17:26:33 +0000 (13:26 -0400)
This ensures that the load command reports a successful load when
the session is found in the user's home session configuration
directory and not in the system-wide session configuration directory.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/config/config.c

index 7c6c49b6661a5b7353b0b2aecf67926938a5bdb6..e74e20f6c016e2fbbfe101c19a52fa0f6de93e18 100644 (file)
@@ -2458,7 +2458,8 @@ int config_load_session(const char *path, const char *session_name,
 
                        ret = load_session_from_path(path, session_name,
                                &validation_ctx, 0);
-                       if (ret && ret != -LTTNG_ERR_LOAD_SESSION_NOENT) {
+                       if (!ret || (ret && ret != -LTTNG_ERR_LOAD_SESSION_NOENT)) {
+                               /* Session found or an error occured */
                                free(path);
                                goto end;
                        }
@@ -2469,7 +2470,8 @@ int config_load_session(const char *path, const char *session_name,
                /* Try system session configuration path */
                ret = load_session_from_path(DEFAULT_SESSION_SYSTEM_CONFIGPATH,
                        session_name, &validation_ctx, 0);
-               if (ret && ret != -LTTNG_ERR_LOAD_SESSION_NOENT) {
+               if (!ret || (ret && ret != -LTTNG_ERR_LOAD_SESSION_NOENT)) {
+                       /* Session found or an error occured */
                        goto end;
                }
        } else {
This page took 0.026883 seconds and 4 git commands to generate.