summaryrefslogtreecommitdiff
path: root/src/nspawn/nspawn.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-12-22 20:33:45 +0100
committerLennart Poettering <lennart@poettering.net>2014-12-23 03:26:24 +0100
commitc7b7d4493aa03e9ef5fb1e670b8969a48aa494dd (patch)
tree4346b1fd2410b60fac0e7a0dab6e027f7fb8bdb0 /src/nspawn/nspawn.c
parent9b15b7846d4de01bb5d9700a24077787e984e8ab (diff)
machinectl,nspawn: don't print extra final newline if pty terminal output was newline-terinated anyway
Diffstat (limited to 'src/nspawn/nspawn.c')
-rw-r--r--src/nspawn/nspawn.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index f1f9b7828d..01b8c3203d 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -3462,6 +3462,7 @@ int main(int argc, char *argv[]) {
if (barrier_place_and_sync(&barrier)) {
_cleanup_event_unref_ sd_event *event = NULL;
_cleanup_(pty_forward_freep) PTYForward *forward = NULL;
+ char last_char = 0;
int ifi = 0;
r = move_network_interfaces(pid);
@@ -3531,9 +3532,11 @@ int main(int argc, char *argv[]) {
goto finish;
}
+ pty_forward_last_char(forward, &last_char);
+
forward = pty_forward_free(forward);
- if (!arg_quiet)
+ if (!arg_quiet && last_char != '\n')
putc('\n', stdout);
/* Kill if it is not dead yet anyway */