Fix enable channel usage and add enable event error msg
[lttng-tools.git] / src / bin / lttng / commands / destroy.c
index 39b4e9a2f6dbe00d0b6a63d6c372455dc07fbfb8..dbd91c2157f4dd8560886952bb9b3926de24c25d 100644 (file)
@@ -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;
 }
This page took 0.023481 seconds and 4 git commands to generate.