xmlNodePtr consumer_output_node;
assert(name);
- assert(kernel_domain);
- assert(ust_domain);
- assert(jul_domain);
if (output_node) {
consumer_output_node = xmlFirstElementChild(output_node);
/* network destination */
if (live_timer_interval && live_timer_interval != UINT64_MAX) {
- const char *url = output.control_uri ?
- output.control_uri : output.data_uri;
-
- /* URL has to be provided, even if we'll overwrite it after. */
- ret = lttng_create_session_live(name, url, live_timer_interval);
+ /*
+ * URLs are provided for sure since the test above make sure that
+ * with a live timer the data and control URIs are provided. So,
+ * NULL is passed here and will be set right after.
+ */
+ ret = lttng_create_session_live(name, NULL, live_timer_interval);
} else {
ret = lttng_create_session(name, NULL);
}
goto end;
}
- ret = load_session_from_path(path, NULL,
+ 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;
}
}
/* Try system session configuration path */
- ret = load_session_from_path(DEFAULT_SESSION_SYSTEM_CONFIGPATH, NULL,
- &validation_ctx, 0);
- if (ret && ret != -LTTNG_ERR_LOAD_SESSION_NOENT) {
+ ret = load_session_from_path(DEFAULT_SESSION_SYSTEM_CONFIGPATH,
+ session_name, &validation_ctx, 0);
+ if (!ret || (ret && ret != -LTTNG_ERR_LOAD_SESSION_NOENT)) {
+ /* Session found or an error occured */
goto end;
}
} else {