From 503546da7cb28219193ccad70b9682bede1f62e5 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 17 Jun 2015 20:54:45 +0200 Subject: 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. --- src/nspawn/nspawn.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/nspawn') 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) { -- cgit v1.2.3-54-g00ecf