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 856ebfa473ac270c70858547aabef498d7360f8d..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"
@@
-701,12
+703,19
@@
sub xsystem {
# Filter output.
my ($buf) = "";
my ($boots) = 0;
# Filter output.
my ($buf) = "";
my ($boots) = 0;
- while (waitpid ($pid, WNOHANG) == 0) {
+ local ($|) = 1;
+ for (;;) {
+ if (waitpid ($pid, WNOHANG) != 0) {
+ # Subprocess died. Pass through any remaining data.
+ print $buf while sysread ($in, $buf, 4096) > 0;
+ last;
+ }
+
# Read and print out pipe data.
my ($len) = length ($buf);
waitpid ($pid, 0), last
if sysread ($in, $buf, 4096, $len) <= 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) {
# Remove full lines from $buf and scan them for keywords.
while ((my $idx = index ($buf, "\n")) >= 0) {
@@
-747,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 ();