From 780d4bb8ec9b4fa0ffd6d1ba2a2aa5d2f812611f Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 8 Aug 2019 16:29:38 -0400 Subject: [PATCH 1/1] Fix: lttng-ctl: public session.h control API: restore 0 success return value MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- include/lttng/session.h | 2 +- src/lib/lttng-ctl/lttng-ctl.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/include/lttng/session.h b/include/lttng/session.h index 8ba817913..395df3245 100644 --- a/include/lttng/session.h +++ b/include/lttng/session.h @@ -130,7 +130,7 @@ extern int lttng_create_session_live(const char *name, const char *url, * * The name can't be NULL here. * - * Returns LTTNG_OK on success, else a negative LTTng error code. + * Return 0 on success else a negative LTTng error code. */ extern int lttng_destroy_session(const char *name); diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index d9e961f2c..ff39b8841 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -1831,7 +1831,7 @@ end: /* * Create a new session using name and url for destination. * - * Returns LTTNG_OK on success or a negative error code. + * Return 0 on success else a negative LTTng error code. */ int lttng_create_session(const char *name, const char *url) { @@ -1886,7 +1886,7 @@ end: /* * Create a session exclusively used for snapshot. * - * Returns LTTNG_OK on success or a negative error code. + * Return 0 on success else a negative LTTng error code. */ int lttng_create_session_snapshot(const char *name, const char *snapshot_url) { @@ -1962,7 +1962,7 @@ end: /* * Create a session exclusively used for live. * - * Returns LTTNG_OK on success or a negative error code. + * Return 0 on success else a negative LTTng error code. */ int lttng_create_session_live(const char *name, const char *url, unsigned int timer_interval) @@ -1996,6 +1996,8 @@ end: /* * Stop the session and wait for the data before destroying it + * + * Return 0 on success else a negative LTTng error code. */ int lttng_destroy_session(const char *session_name) { @@ -2032,7 +2034,7 @@ int lttng_destroy_session(const char *session_name) ret = -LTTNG_ERR_UNK; goto end; } - ret = ret_code == LTTNG_OK ? LTTNG_OK : -ret_code; + ret = ret_code == LTTNG_OK ? 0 : -ret_code; end: lttng_destruction_handle_destroy(handle); return ret; -- 2.34.1