From: Lennart Poettering Date: Wed, 17 Jun 2015 18:54:45 +0000 (+0200) Subject: nspawn: when exiting, flush all remaining bytes from the pty to stdout X-Git-Tag: v221~24^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=503546da7cb28219193ccad70b9682bede1f62e5;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index 3c31629d1e9..d1154de08a1 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) {