Fix: Succesful session load might still report an error
[lttng-tools.git] / 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.025216 seconds and 5 git commands to generate.