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 <jeremie.galarneau@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
ret = load_session_from_path(path, session_name,
&validation_ctx, 0);
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 */
/* Try system session configuration path */
ret = load_session_from_path(DEFAULT_SESSION_SYSTEM_CONFIGPATH,
session_name, &validation_ctx, 0);
/* 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 */