Fix: ensure a newline is printed before exit on client destroy
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 22 Jul 2019 21:55:38 +0000 (17:55 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 9 Aug 2019 15:28:43 +0000 (11:28 -0400)
Errors encountered during the destruction of a session can cause
the `lttng` client to exit after having printed the
'Waiting for destruction of session ...' message without printing
a newline. This causes the user's prompt to reappear after the
message and not on a new line.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/destroy.c

index 7cea7bf23303a6a2cadf48709f881f58c79964f5..e52735f439a453067f6099c59ba7a594891a72b4 100644 (file)
@@ -192,6 +192,7 @@ static int destroy_session(struct lttng_session *session)
 skip_wait_rotation:
        MSG("%sSession \"%s\" destroyed", printed_wait_msg ? "\n" : "",
                        session->name);
+       printed_wait_msg = false;
 
        session_name = get_session_name_quiet();
        if (session_name && !strncmp(session->name, session_name, NAME_MAX)) {
@@ -208,6 +209,9 @@ skip_wait_rotation:
 
        ret = CMD_SUCCESS;
 error:
+       if (printed_wait_msg) {
+               MSG("");
+       }
        lttng_destruction_handle_destroy(handle);
        free(session_name);
        return ret;
This page took 0.026605 seconds and 5 git commands to generate.