pintos: Avoid literal control character in Perl variable name.
[pintos-anon] / src / utils / pintos
index eca4708516e41f3c715d2145e761ba775036ed6a..2ebe642a5d1de310121d7f9acb2989cabb181b84 100755 (executable)
@@ -827,8 +827,8 @@ sub xsystem {
 
                # Read and print out pipe data.
                my ($len) = length ($buf);
-               waitpid ($pid, 0), last
-                 if sysread ($in, $buf, 4096, $len) <= 0;
+               my ($n_read) = sysread ($in, $buf, 4096, $len);
+               waitpid ($pid, 0), last if !defined ($n_read) || $n_read <= 0;
                print substr ($buf, $len);
 
                # Remove full lines from $buf and scan them for keywords.
@@ -912,7 +912,7 @@ sub get_load_average {
 # Calls setitimer to set a timeout, then execs what was passed to us.
 sub exec_setitimer {
     if (defined $timeout) {
-       if ($\16 ge 5.8.0) {
+       if ($^V ge 5.8.0) {
            eval "
               use Time::HiRes qw(setitimer ITIMER_VIRTUAL);
               setitimer (ITIMER_VIRTUAL, $timeout, 0);