From f16edb77944b361ceaef95bf290d634231cf55b1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Mon, 22 Jul 2019 17:55:38 -0400 Subject: [PATCH] Fix: ensure a newline is printed before exit on client destroy MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/bin/lttng/commands/destroy.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bin/lttng/commands/destroy.c b/src/bin/lttng/commands/destroy.c index 7cea7bf23..e52735f43 100644 --- a/src/bin/lttng/commands/destroy.c +++ b/src/bin/lttng/commands/destroy.c @@ -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; -- 2.34.1