X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=grading%2Fuserprog%2Fprep-disk;h=39d078eba540b0e82a950eafe47dfb4b1bc6b161;hb=5780c9f434cca090f88463b7f0199d49b4ded288;hp=f37a68297b11d2502190f71a51305dc41f5510a2;hpb=11a17764b481254af85ce318bac15b0db7b0726d;p=pintos-anon diff --git a/grading/userprog/prep-disk b/grading/userprog/prep-disk index f37a682..39d078e 100755 --- a/grading/userprog/prep-disk +++ b/grading/userprog/prep-disk @@ -34,7 +34,7 @@ if (! -e $os_disk) { our ($formatted) = 0; unlink $fs_disk; -xsystem (0, "$pintos make-disk '$fs_disk' 2"); +xsystem ("$pintos make-disk '$fs_disk' 2"); put_file ("$test"); put_file ("sample.txt") if grep ($_ eq $test, @@ -46,23 +46,21 @@ put_file ("sample.txt") put_file ("child-simple") if grep ($_ eq $test, qw (exec-once exec-multiple - join-simple join-twice)); + wait-simple wait-twice)); put_file ("child-arg") if $test eq 'exec-arg'; put_file ("child-close") if $test eq 'multi-child-fd'; -put_file ("child-bad") if $test eq 'join-killed'; +put_file ("child-bad") if $test eq 'wait-killed'; sub put_file { my ($fn) = @_; my ($cmd) = "$pintos -v --os-disk='$os_disk' --fs-disk='$fs_disk' put"; $cmd .= " -f", $formatted = 1 if !$formatted; $cmd .= " '$fn'"; - xsystem (1, $cmd); + xsystem ($cmd); } sub xsystem { - my ($expect, $cmd) = @_; + my ($cmd) = @_; print "$cmd\n"; - my ($code) = system ($cmd); - WIFEXITED ($code) && WEXITSTATUS ($code) == $expect - or die "command failed\n"; + system ($cmd) == 0 or die "command failed\n"; }