Fix: lttng UI exit value and error message
[lttng-tools.git] / src / bin / lttng / commands / create.c
index fcf6e128941877a46322827b046e3d79e5043c6d..b1f3e8a777a0420ca4f5de66c7c9032118780015 100644 (file)
@@ -28,6 +28,8 @@
 #include "../command.h"
 #include "../utils.h"
 
+#include <common/sessiond-comm/sessiond-comm.h>
+
 static char *opt_output_path;
 static char *opt_session_name;
 
@@ -119,6 +121,11 @@ static int create_session()
        ret = lttng_create_session(session_name, traces_path);
        if (ret < 0) {
                /* Don't set ret so lttng can interpret the sessiond error. */
+               switch (-ret) {
+               case LTTCOMM_EXIST_SESS:
+                       WARN("Session %s already exists", session_name);
+                       break;
+               }
                goto error;
        }
 
This page took 0.02298 seconds and 4 git commands to generate.