Only consider a disk to exist if it has nonzero size.
authorBen Pfaff <blp@cs.stanford.edu>
Tue, 22 Feb 2005 20:54:06 +0000 (20:54 +0000)
committerBen Pfaff <blp@cs.stanford.edu>
Tue, 22 Feb 2005 20:54:06 +0000 (20:54 +0000)
src/utils/pintos

index ea4bdcc5da20dbb4c1d7956bedace31a8849f15d..40a240ce974a66c0d590597be4bed25bed0e52dd 100755 (executable)
@@ -214,8 +214,9 @@ sub run_vm {
     our (@disks);
 
     die "$disks[0]: can't find OS disk\n" if ! -e $disks[0];
+    die "$disks[0]: OS disk cannot have zero size\n" if ! -s $disks[0];
     for my $i (1...3) {
-       undef $disks[$i] if ! -e $disks[$i];
+       undef $disks[$i] if ! -s $disks[$i];
     }
 
     if (my ($project) = `pwd` =~ /\b(threads|userprog|vm|filesys)\b/) {