ptyfwd: always write additional line break on stop

Currently we do that in the user of PTY forwarder, e.g. nspawn.
But, let's do that unconditionally in the PTY forwarder.
This commit is contained in:
Yu Watanabe
2024-12-18 20:26:58 +09:00
parent d517427dff
commit 4a4e7ec0e9
5 changed files with 14 additions and 35 deletions
+1 -8
View File
@@ -5740,16 +5740,9 @@ static int run_container(
if (r < 0)
return log_error_errno(r, "Failed to run event loop: %m");
if (forward) {
char last_char = 0;
(void) pty_forward_get_last_char(forward, &last_char);
if (forward)
forward = pty_forward_free(forward);
if (!arg_quiet && last_char != '\n')
putc('\n', stdout);
}
/* Kill if it is not dead yet anyway */
if (!arg_register && !arg_keep_unit && bus)
terminate_scope(bus, arg_machine);