Skip to content

Commit

Permalink
Fix: lttng-ctl: public session.h control API: restore 0 success retur…
Browse files Browse the repository at this point in the history
…n value

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
  • Loading branch information
compudj authored and jgalar committed Aug 9, 2019
1 parent a5ba6fd commit 780d4bb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/lttng/session.h
Expand Up @@ -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);

Expand Down
10 changes: 6 additions & 4 deletions src/lib/lttng-ctl/lttng-ctl.c
Expand Up @@ -1831,7 +1831,7 @@ enum lttng_error_code lttng_create_session_ext(
/*
* 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)
{
Expand Down Expand Up @@ -1886,7 +1886,7 @@ int lttng_create_session(const char *name, const char *url)
/*
* 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)
{
Expand Down Expand Up @@ -1962,7 +1962,7 @@ int lttng_create_session_snapshot(const char *name, const char *snapshot_url)
/*
* 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)
Expand Down Expand Up @@ -1996,6 +1996,8 @@ int lttng_create_session_live(const char *name, const char *url,

/*
* 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)
{
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 780d4bb

Please sign in to comment.