Fix: lttng UI exit value and error message
[lttng-tools.git] / src / bin / lttng / commands / stop.c
index fbabc510039f2f5fc8c5486b6240bf64d6326780..6ed67fdabcaaf0194cbbe911c3853609aa3720de 100644 (file)
@@ -26,6 +26,8 @@
 
 #include "../command.h"
 
+#include <common/sessiond-comm/sessiond-comm.h>
+
 static char *opt_session_name;
 
 enum {
@@ -75,7 +77,14 @@ static int stop_tracing(void)
 
        ret = lttng_stop_tracing(session_name);
        if (ret < 0) {
-               /* Don't set ret so lttng can interpret the sessiond error. */
+               switch (-ret) {
+               case LTTCOMM_TRACE_ALREADY_STOPPED:
+                       WARN("Tracing already stopped for session %s", session_name);
+                       break;
+               default:
+                       ERR("%s", lttng_strerror(ret));
+                       break;
+               }
                goto free_name;
        }
 
This page took 0.023755 seconds and 4 git commands to generate.