]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
nspawn: when exiting, flush all remaining bytes from the pty to stdout 272/head
authorLennart Poettering <lennart@poettering.net>
Wed, 17 Jun 2015 18:54:45 +0000 (20:54 +0200)
committerLennart Poettering <lennart@poettering.net>
Wed, 17 Jun 2015 18:54:45 +0000 (20:54 +0200)
This is a simpler fix for #210, it simply uses copy_bytes() for the
copying.

src/nspawn/nspawn.c

index 3c31629d1e919c3bf86ae8c36b23eef12e0cdd37..d1154de08a1d6867d22e864d30f8fd951f79e8a4 100644 (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) {