projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix two bugs:
[pintos-anon]
/
src
/
utils
/
pintos
diff --git
a/src/utils/pintos
b/src/utils/pintos
index 079ab5a34d22e8970a631203acdf6913e2a7a4fe..ccf10377641baf04ee31ad679e4df626b8f16dcc 100755
(executable)
--- a/
src/utils/pintos
+++ b/
src/utils/pintos
@@
-492,7
+492,9
@@
config.version = 6
guestOS = "linux"
floppy0.present = FALSE
memsize = $mem
guestOS = "linux"
floppy0.present = FALSE
memsize = $mem
+EOF
+ print VMX <<EOF if $serial;
serial0.present = TRUE
serial0.fileType = "file"
serial0.fileName = "pintos.out"
serial0.present = TRUE
serial0.fileType = "file"
serial0.fileName = "pintos.out"
@@
-703,7
+705,7
@@
sub xsystem {
my ($boots) = 0;
local ($|) = 1;
for (;;) {
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;
# Subprocess died. Pass through any remaining data.
print $buf while sysread ($in, $buf, 4096) > 0;
last;
@@
-711,7
+713,8
@@
sub xsystem {
# Read and print out pipe data.
my ($len) = length ($buf);
# 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.
print substr ($buf, $len);
# Remove full lines from $buf and scan them for keywords.
@@
-730,8
+733,9
@@
sub xsystem {
}
}
}
}
}
}
+ } else {
+ waitpid ($pid, 0);
}
}
- waitpid ($pid, 0);
alarm (0);
&$cleanup ();
alarm (0);
&$cleanup ();
@@
-752,7
+756,7
@@
sub xsystem {
sub relay_signal {
my ($pid, $signal, $cleanup) = @_;
kill $signal, $pid;
sub relay_signal {
my ($pid, $signal, $cleanup) = @_;
kill $signal, $pid;
- File::Temp::cleanup();
+ eval { File::Temp::cleanup() }; # Not defined in old File::Temp.
&$cleanup ();
$SIG{$signal} = 'DEFAULT';
kill $signal, getpid ();
&$cleanup ();
$SIG{$signal} = 'DEFAULT';
kill $signal, getpid ();