From: Ben Pfaff Date: Tue, 30 May 2006 21:33:10 +0000 (+0000) Subject: Fix stupidity in last check-in. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pintos-anon;a=commitdiff_plain;h=b8632191cf88da4debca435c1ac834ba17428b01 Fix stupidity in last check-in. --- diff --git a/src/utils/pintos b/src/utils/pintos index 079ab5a..13d7e54 100755 --- a/src/utils/pintos +++ b/src/utils/pintos @@ -703,7 +703,7 @@ sub xsystem { my ($boots) = 0; local ($|) = 1; for (;;) { - if (waitpid ($pid, WNOHANG) == 0) { + if (waitpid ($pid, WNOHANG) != 0) { # Subprocess died. Pass through any remaining data. print $buf while sysread ($in, $buf, 4096) > 0; last; @@ -711,7 +711,8 @@ sub xsystem { # Read and print out pipe data. my ($len) = length ($buf); - last if sysread ($in, $buf, 4096, $len) <= 0; + waitpid ($pid, 0), last + if sysread ($in, $buf, 4096, $len) <= 0; print substr ($buf, $len); # Remove full lines from $buf and scan them for keywords. @@ -730,8 +731,9 @@ sub xsystem { } } } + } else { + waitpid ($pid, 0); } - waitpid ($pid, 0); alarm (0); &$cleanup ();