X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng%2Fcommands%2Fdestroy.c;h=e1833c89ccd8183609f0b18065764691ac6117ae;hb=57064adac0e3399dc34d7f6259cb6de5cef6edd4;hp=39b4e9a2f6dbe00d0b6a63d6c372455dc07fbfb8;hpb=679b4943c3b0f451e7f4fbcd804dd8a7a679e253;p=lttng-tools.git diff --git a/src/bin/lttng/commands/destroy.c b/src/bin/lttng/commands/destroy.c index 39b4e9a2f..e1833c89c 100644 --- a/src/bin/lttng/commands/destroy.c +++ b/src/bin/lttng/commands/destroy.c @@ -52,7 +52,7 @@ static void usage(FILE *ofp) fprintf(ofp, "get it from the configuration directory (.lttng).\n"); fprintf(ofp, "\n"); fprintf(ofp, " -h, --help Show this help\n"); - fprintf(ofp, " --list-options Simple listing of options\n"); + fprintf(ofp, " --list-options Simple listing of options\n"); fprintf(ofp, "\n"); } @@ -77,6 +77,7 @@ static int destroy_session() ret = lttng_destroy_session(session_name); if (ret < 0) { + /* Don't set ret so lttng can interpret the sessiond error. */ goto free_name; } @@ -117,11 +118,10 @@ int cmd_destroy(int argc, const char **argv) while ((opt = poptGetNextOpt(pc)) != -1) { switch (opt) { case OPT_HELP: - usage(stderr); + usage(stdout); goto end; case OPT_LIST_OPTIONS: list_cmd_options(stdout, long_options); - ret = CMD_SUCCESS; goto end; default: usage(stderr); @@ -135,5 +135,6 @@ int cmd_destroy(int argc, const char **argv) ret = destroy_session(); end: + poptFreeContext(pc); return ret; }