X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fcommon%2Fconfig%2Fsession-config.c;h=946e8ccb7c8d33d90115c9881a7126e324a427d1;hb=96639848280e5dae29b0b03e895b0f9868a4ef50;hp=a8ea68eda42fdb92fc0177d02a6c239d6d281bd4;hpb=91aba064548875ea291d793bb149ac9035e240f7;p=lttng-tools.git diff --git a/src/common/config/session-config.c b/src/common/config/session-config.c index a8ea68eda..946e8ccb7 100644 --- a/src/common/config/session-config.c +++ b/src/common/config/session-config.c @@ -1,7 +1,7 @@ /* * Copyright (C) 2013 Jérémie Galarneau * - * SPDX-License-Identifier: GPL-2.0-only + * SPDX-License-Identifier: LGPL-2.1-only * */ @@ -847,7 +847,7 @@ int parse_bool(xmlChar *str, int *val) } else if (!strcmp((const char *) str, config_xml_false)) { *val = 0; } else { - WARN("Invalid boolean value encoutered (%s).", + WARN("Invalid boolean value encountered (%s).", (const char *) str); ret = -1; } @@ -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; }