X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fconfig%2Fsession-config.c;fp=src%2Fcommon%2Fconfig%2Fsession-config.c;h=e893c129863fe5a2d593226f85922f349c2f985c;hp=a8ea68eda42fdb92fc0177d02a6c239d6d281bd4;hb=317ea246af2890928a75913db461ff2f417e518c;hpb=2666d3521813f94d6c6ed055f2beaf759989ce59 diff --git a/src/common/config/session-config.c b/src/common/config/session-config.c index a8ea68eda..e893c1298 100644 --- a/src/common/config/session-config.c +++ b/src/common/config/session-config.c @@ -3767,10 +3767,24 @@ int load_session_from_file(const char *path, const char *session_name, xmlNextElementSibling(session_node)) { ret = process_session_node(session_node, session_name, overwrite, overrides); - if (session_name && ret == 0) { - /* Target session found and loaded */ - session_found = 1; - break; + if (!session_name && ret) { + /* Loading error occurred. */ + goto end; + } else if (session_name) { + if (ret == 0) { + /* Target session found and loaded */ + session_found = 1; + break; + } else if (ret == -LTTNG_ERR_NO_SESSION) { + /* + * Ignore this error, we are looking for a + * specific session. + */ + ret = 0; + } else { + /* Loading error occurred. */ + goto end; + } } } end: @@ -3778,9 +3792,6 @@ end: if (!ret) { ret = session_found ? 0 : -LTTNG_ERR_LOAD_SESSION_NOENT; } - if (ret == -LTTNG_ERR_NO_SESSION) { - ret = -LTTNG_ERR_LOAD_SESSION_NOENT; - } return ret; }