Fix: lttng_destroy_session_no_wait: return 0 on success
authorChristophe Bedard <christophe.bedard@apex.ai>
Fri, 28 Aug 2020 15:00:30 +0000 (11:00 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 11 May 2021 17:27:22 +0000 (13:27 -0400)
lttng_destroy_session_no_wait() is supposed to behave like
lttng_destroy_session():

> Return 0 on success else a negative LTTNg error code.

However, it returns LTTNG_OK on success. Make it return 0 instead.

Signed-off-by: Christophe Bedard <christophe.bedard@apex.ai>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I787307d4291babfb9ddcb12937efdbfbb5fd7009

src/lib/lttng-ctl/lttng-ctl.c

index ad4974a1395cd4d284a3c56b3ac10bf4178c0381..b28656ee19be5fb8e70d4f372e147fea05d2419b 100644 (file)
@@ -2128,7 +2128,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.027047 seconds and 4 git commands to generate.