From: Jérémie Galarneau Date: Wed, 19 Mar 2014 15:29:18 +0000 (-0400) Subject: Fix: Succesful session load might still report an error X-Git-Tag: v2.5.0-rc1~102 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=5a8f54da84e1df8beadfef3a9f866e35a3ea13dd;p=lttng-tools.git Fix: Succesful session load might still report an error 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 Signed-off-by: David Goulet --- 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 {