summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-06-18 00:34:22 +0200
committerDaniel Mack <github@zonque.org>2015-06-18 00:34:22 +0200
commit867a99b4061749d51b3350672715eceb9f585570 (patch)
treeac20d65844cf231566874f509105549914f2609f
parent561471314c1a55660063467422509352192e3408 (diff)
parent503546da7cb28219193ccad70b9682bede1f62e5 (diff)
Merge pull request #272 from poettering/nspawn-flush-copy-fd
nspawn: when exiting, flush all remaining bytes from the pty to stdout
-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) {