X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fconfig%2Fconfig.c;h=e74e20f6c016e2fbbfe101c19a52fa0f6de93e18;hp=7c6c49b6661a5b7353b0b2aecf67926938a5bdb6;hb=5a8f54da84e1df8beadfef3a9f866e35a3ea13dd;hpb=883d970a45de63864c1b2ae956fc01e835e351c4 diff --git a/src/common/config/config.c b/src/common/config/config.c index 7c6c49b66..e74e20f6c 100644 --- a/src/common/config/config.c +++ b/src/common/config/config.c @@ -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 {