Remove -s option from lttng load command
[lttng-tools.git] / src / common / config / config.c
index e74e20f6c016e2fbbfe101c19a52fa0f6de93e18..0e9e1bdc722661c21fb4172b27ba49a593b742ae 100644 (file)
@@ -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);
                }
@@ -2341,9 +2342,15 @@ int load_session_from_path(const char *path, const char *session_name,
 
        directory = opendir(path);
        if (!directory) {
-               if (errno != ENOTDIR) {
+               switch (errno) {
+               case ENOTDIR:
                        ret = -LTTNG_ERR_LOAD_IO_FAIL;
                        goto end;
+               case ENOENT:
+                       ret = -LTTNG_ERR_LOAD_SESSION_NOENT;
+                       goto end;
+               default:
+                       break;
                }
        }
        if (directory) {
This page took 0.024314 seconds and 5 git commands to generate.