X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fcommon%2Fconfig%2Fconfig.c;h=722904772316c0fc0b48f548817a472e051247a1;hb=b664f89a924cc708174003a2b570f5a221905b8e;hp=7c6c49b6661a5b7353b0b2aecf67926938a5bdb6;hpb=883d970a45de63864c1b2ae956fc01e835e351c4;p=lttng-tools.git diff --git a/src/common/config/config.c b/src/common/config/config.c index 7c6c49b66..722904772 100644 --- a/src/common/config/config.c +++ b/src/common/config/config.c @@ -1222,11 +1222,12 @@ int create_session(const char *name, /* 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); } @@ -2458,7 +2459,8 @@ int config_load_session(const char *path, const char *session_name, 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; } @@ -2469,7 +2471,8 @@ int config_load_session(const char *path, const char *session_name, /* 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 */ goto end; } } else {