projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
969652b
)
Make stdout unbuffered while filtering output.
author
Ben Pfaff
<blp@cs.stanford.edu>
Tue, 30 May 2006 19:25:32 +0000
(19:25 +0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Tue, 30 May 2006 19:25:32 +0000
(19:25 +0000)
src/utils/pintos
patch
|
blob
|
history
diff --git
a/src/utils/pintos
b/src/utils/pintos
index 856ebfa473ac270c70858547aabef498d7360f8d..b18693b776f6bf1679ded0b590f1c690c9500114 100755
(executable)
--- a/
src/utils/pintos
+++ b/
src/utils/pintos
@@
-701,12
+701,13
@@
sub xsystem {
# Filter output.
my ($buf) = "";
my ($boots) = 0;
+ local ($|) = 1;
while (waitpid ($pid, WNOHANG) == 0) {
# Read and print out pipe data.
my ($len) = length ($buf);
waitpid ($pid, 0), last
if sysread ($in, $buf, 4096, $len) <= 0;
- print
STDOUT
substr ($buf, $len);
+ print substr ($buf, $len);
# Remove full lines from $buf and scan them for keywords.
while ((my $idx = index ($buf, "\n")) >= 0) {