X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=lttng%2Fcommands%2Fdestroy.c;h=3b02a53eee41fe9eea8e8c1b2472f640404db86b;hp=1eca989e6cdd6e826b28f452dd1bbdb1209073af;hb=35346445460dfe7ba5bbcfdbe279c07c1ee3219b;hpb=82a3637f639486c07ff937ab03e1e9532379d26a diff --git a/lttng/commands/destroy.c b/lttng/commands/destroy.c index 1eca989e6..3b02a53ee 100644 --- a/lttng/commands/destroy.c +++ b/lttng/commands/destroy.c @@ -25,11 +25,12 @@ #include #include -#include "cmd.h" -#include "conf.h" -#include "utils.h" +#include "../cmd.h" +#include "../conf.h" +#include "../utils.h" static char *opt_session_name; +static struct lttng_handle *handle; enum { OPT_HELP = 1, @@ -76,7 +77,13 @@ static int destroy_session() session_name = opt_session_name; } - ret = lttng_destroy_session(session_name); + handle = lttng_create_handle(session_name, NULL); + if (handle == NULL) { + ret = -1; + goto error; + } + + ret = lttng_destroy_session(handle); if (ret < 0) { goto free_name; } @@ -101,6 +108,8 @@ free_name: free(session_name); } error: + lttng_destroy_handle(handle); + return ret; }