mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
use part->size
This commit is contained in:
parent
a9ecda2da9
commit
1726f602fe
1 changed files with 2 additions and 6 deletions
|
@ -68,7 +68,6 @@ threadmain(int argc, char *argv[])
|
|||
Arena *arena;
|
||||
u64int offset, aoffset;
|
||||
Part *part;
|
||||
Dir *d;
|
||||
uchar buf[8192];
|
||||
ArenaHead head;
|
||||
|
||||
|
@ -98,9 +97,6 @@ threadmain(int argc, char *argv[])
|
|||
ventifmtinstall();
|
||||
statsinit();
|
||||
|
||||
if((d = dirstat(file)) == nil)
|
||||
sysfatal("can't stat file %s: %r", file);
|
||||
|
||||
part = initpart(file, OREAD|ODIRECT);
|
||||
if(part == nil)
|
||||
sysfatal("can't open file %s: %r", file);
|
||||
|
@ -114,9 +110,9 @@ threadmain(int argc, char *argv[])
|
|||
head.version, ANameSize, head.name, head.blocksize,
|
||||
head.size, head.clumpmagic);
|
||||
|
||||
if(aoffset+head.size > d->length)
|
||||
if(aoffset+head.size > part->size)
|
||||
sysfatal("arena is truncated: want %llud bytes have %llud\n",
|
||||
head.size, d->length);
|
||||
head.size, part->size);
|
||||
|
||||
partblocksize(part, head.blocksize);
|
||||
initdcache(8 * MaxDiskBlock);
|
||||
|
|
Loading…
Reference in a new issue