projects
/
pintos-anon
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a40483c
)
Fix zero-length file case on put.
author
Ben Pfaff
<blp@cs.stanford.edu>
Tue, 14 Dec 2004 01:33:44 +0000
(
01:33
+0000)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Tue, 14 Dec 2004 01:33:44 +0000
(
01:33
+0000)
src/utils/pintos
patch
|
blob
|
history
diff --git
a/src/utils/pintos
b/src/utils/pintos
index 124269848c0926063935cd0e4a7d897b162a310d..a3c9c4c2a54679985323438d8c456718f6177b62 100755
(executable)
--- a/
src/utils/pintos
+++ b/
src/utils/pintos
@@
-110,7
+110,13
@@
if ($cmd eq 'run') {
# Create scratch disk from file.
die "$hostfn: $!\n" if ! -e $hostfn;
my ($size) = -s _;
- copy_pad ($hostfn, "scratch.dsk", 512);
+ if ($size) {
+ copy_pad ($hostfn, "scratch.dsk", 512);
+ } else {
+ open (SCRATCH, ">scratch.dsk") or die "scratch.dsk: create: $!\n";
+ syswrite (SCRATCH, "\0" x 512);
+ close (SCRATCH);
+ }
# Do copy.
my (@cmd) = ("-ci", $guestfn, $size, "-q");