summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-06-17 20:54:45 +0200
committerLennart Poettering <lennart@poettering.net>2015-06-17 20:54:45 +0200
commit503546da7cb28219193ccad70b9682bede1f62e5 (patch)
tree15123ecb4d2dfddd19491b44b1ddc95bcbc3e024 /src
parent7391cb5d581c4d48dec689686fd9514fdb7d4888 (diff)
nspawn: when exiting, flush all remaining bytes from the pty to stdout
This is a simpler fix for #210, it simply uses copy_bytes() for the copying.
Diffstat (limited to 'src')
-rw-r--r--src/nspawn/nspawn.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 3c31629d1e..d1154de08a 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -4972,6 +4972,10 @@ finish:
if (pid > 0)
kill(pid, SIGKILL);
+ /* Try to flush whatever is still queued in the pty */
+ if (master >= 0)
+ (void) copy_bytes(master, STDOUT_FILENO, (off_t) -1, false);
+
loop_remove(loop_nr, &image_fd);
if (remove_subvol && arg_directory) {