Fix: lttng-ctl: public session.h control API: restore 0 success return value
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 8 Aug 2019 20:29:38 +0000 (16:29 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 9 Aug 2019 15:28:43 +0000 (11:28 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
include/lttng/session.h
src/lib/lttng-ctl/lttng-ctl.c

index 8ba8179136f09931ed66e21247fa3124d69e408f..395df32450889d806aa0efd805a7a2cd67f4c219 100644 (file)
@@ -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);
 
index d9e961f2cf1deb243a60a6133a8264acedbb7d28..ff39b88416e4d4410cd5af453a6e92baf4226a10 100644 (file)
@@ -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;
This page took 0.027677 seconds and 4 git commands to generate.