X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=lttng%2Fcommands%2Fdestroy.c;h=3b02a53eee41fe9eea8e8c1b2472f640404db86b;hp=516f8ab9521a539c6ed109be40476640df6730df;hb=cd80958d00fddabced5fbd60641978516a01e29e;hpb=8b270bdb4dccf5571180a9906084126e90eec949 diff --git a/lttng/commands/destroy.c b/lttng/commands/destroy.c index 516f8ab95..3b02a53ee 100644 --- a/lttng/commands/destroy.c +++ b/lttng/commands/destroy.c @@ -30,6 +30,7 @@ #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; }