Fix: lttng_destroy_session_no_wait: return 0 on success
[lttng-tools.git] / src / lib / lttng-ctl / lttng-ctl.c
index 5529b3364f12027c8b143fbdcba8a4e7304dad70..52b5263d89ae34c046be44c94766caf94bb1be9e 100644 (file)
@@ -18,6 +18,7 @@
 #include <string.h>
 #include <unistd.h>
 
+#include <common/bytecode/bytecode.h>
 #include <common/common.h>
 #include <common/compat/errno.h>
 #include <common/compat/string.h>
@@ -45,7 +46,6 @@
 
 #include <common/filter/filter-ast.h>
 #include <common/filter/filter-parser.h>
-#include <common/filter/filter-bytecode.h>
 #include <common/filter/memstream.h>
 #include "lttng-ctl-helper.h"
 
@@ -1270,15 +1270,15 @@ int lttng_enable_event_with_exclusions(struct lttng_handle *handle,
 
                assert(fd_count == 0 || fd_count == 1);
                if (fd_count == 1) {
-                       struct fd_handle *handle =
+                       struct fd_handle *h =
                                        lttng_payload_view_pop_fd_handle(&view);
 
-                       if (!handle) {
+                       if (!h) {
                                goto mem_error;
                        }
 
-                       fd_to_send = fd_handle_get_fd(handle);
-                       fd_handle_put(handle);
+                       fd_to_send = fd_handle_get_fd(h);
+                       fd_handle_put(h);
                }
 
                ret = lttng_ctl_ask_sessiond_fds_varlen(&lsm,
@@ -2070,7 +2070,7 @@ int lttng_destroy_session_no_wait(const char *session_name)
        enum lttng_error_code ret_code;
 
        ret_code = lttng_destroy_session_ext(session_name, NULL);
-       return ret_code == LTTNG_OK ? ret_code : -ret_code;
+       return ret_code == LTTNG_OK ? 0 : -ret_code;
 }
 
 /*
This page took 0.023311 seconds and 4 git commands to generate.