From 94b11a65805343eb3a4679f695a4f41cae69559e Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 7 Jan 2010 09:26:11 -0800 Subject: [PATCH] pintos: Make sure to print buffered data at end of input. Here, $buf might have some data in it that has not yet been printed, but we were discarding it (and trying to read more) without printing it. (In Perl, "do" ensures that the inner block runs at least once; without "do" the condition is evaluated first.) --- src/utils/pintos | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/pintos b/src/utils/pintos index 1abd2ed..909df83 100755 --- a/src/utils/pintos +++ b/src/utils/pintos @@ -819,7 +819,7 @@ sub xsystem { for (;;) { if (waitpid ($pid, WNOHANG) != 0) { # Subprocess died. Pass through any remaining data. - print $buf while sysread ($in, $buf, 4096) > 0; + do { print $buf } while sysread ($in, $buf, 4096) > 0; last; } -- 2.30.2