From 5a8f54da84e1df8beadfef3a9f866e35a3ea13dd Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 19 Mar 2014 11:29:18 -0400 Subject: [PATCH] Fix: Succesful session load might still report an error MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/common/config/config.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 { -- 2.34.1