/*
* Copyright (C) 2013 Jérémie Galarneau <jeremie.galarneau@efficios.com>
*
- * SPDX-License-Identifier: GPL-2.0-only
+ * SPDX-License-Identifier: LGPL-2.1-only
*
*/
} 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;
}
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:
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;
}