Fix: lttng UI exit value and error message
[lttng-tools.git] / src / bin / lttng / commands / destroy.c
index 49b263cc2a1dc6c36777a1f2fa982989eb0583c1..a179da83f576ce3700ba3d2148df6235d3b2f2fb 100644 (file)
@@ -26,6 +26,8 @@
 
 #include "../command.h"
 
+#include <common/sessiond-comm/sessiond-comm.h>
+
 static char *opt_session_name;
 
 enum {
@@ -76,7 +78,13 @@ static int destroy_session()
 
        ret = lttng_destroy_session(session_name);
        if (ret < 0) {
-               /* Don't set ret so lttng can interpret the sessiond error. */
+               switch (-ret) {
+               case LTTCOMM_SESS_NOT_FOUND:
+                       WARN("Session name %s not found", session_name);
+                       break;
+               default:
+                       break;
+               }
                goto free_name;
        }
 
This page took 0.023478 seconds and 4 git commands to generate.