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.
This commit is contained in:
Lennart Poettering 2015-06-17 20:54:45 +02:00
parent 7391cb5d58
commit 503546da7c

View file

@ -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) {