X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fconfig%2Fconfig.c;h=e74e20f6c016e2fbbfe101c19a52fa0f6de93e18;hb=5a8f54da84e1df8beadfef3a9f866e35a3ea13dd;hp=13af2f117e7bf7306cdab4930d45a711da5312ab;hpb=7c6b168498857c3b359021114f7d3c2950051da1;p=lttng-tools.git diff --git a/src/common/config/config.c b/src/common/config/config.c index 13af2f117..e74e20f6c 100644 --- a/src/common/config/config.c +++ b/src/common/config/config.c @@ -2456,9 +2456,10 @@ int config_load_session(const char *path, const char *session_name, goto end; } - ret = load_session_from_path(path, NULL, + 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; } @@ -2467,9 +2468,10 @@ 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, NULL, - &validation_ctx, 0); - if (ret && ret != -LTTNG_ERR_LOAD_SESSION_NOENT) { + ret = load_session_from_path(DEFAULT_SESSION_SYSTEM_CONFIGPATH, + session_name, &validation_ctx, 0); + if (!ret || (ret && ret != -LTTNG_ERR_LOAD_SESSION_NOENT)) { + /* Session found or an error occured */ goto end; } } else {