Fix: wait for the completion of implicit session rotations
[lttng-tools.git] / src / bin / lttng / commands / destroy.c
index 02c7139c3547e4e9a4dff2516e223597081faa76..77acb180f8b8d91ee44bfd6249f86c4c8cc696b1 100644 (file)
@@ -113,7 +113,7 @@ static int destroy_session(struct lttng_session *session)
                print_session_stats(session->name);
        }
 
-       ret = lttng_destroy_session_no_wait(session->name);
+       ret = lttng_destroy_session(session->name);
        if (ret < 0) {
                goto error;
        }
@@ -174,6 +174,7 @@ int cmd_destroy(int argc, const char **argv)
        int ret = CMD_SUCCESS , i, command_ret = CMD_SUCCESS, success = 1;
        static poptContext pc;
        char *session_name = NULL;
+       const char *leftover = NULL;
 
        struct lttng_session *sessions;
        int count;
@@ -280,6 +281,14 @@ int cmd_destroy(int argc, const char **argv)
                }
        }
 
+       leftover = poptGetArg(pc);
+       if (leftover) {
+               ERR("Unknown argument: %s", leftover);
+               ret = CMD_ERROR;
+               success = 0;
+               goto mi_closing;
+       }
+
 mi_closing:
        /* Mi closing */
        if (lttng_opt_mi) {
This page took 0.026643 seconds and 5 git commands to generate.