From: John Hodge Date: Sat, 14 Jul 2012 12:27:00 +0000 (+0800) Subject: Kernel - Fixed bug in DrvUtil_Disk causing bad return values X-Git-Tag: rel0.15~611^2~30 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=8d007b60d33c7323b7ed53b58004e461a89e507f;p=tpg%2Facess2.git Kernel - Fixed bug in DrvUtil_Disk causing bad return values --- diff --git a/KernelLand/Kernel/drvutil_disk.c b/KernelLand/Kernel/drvutil_disk.c index db4d631a..49dc7b23 100644 --- a/KernelLand/Kernel/drvutil_disk.c +++ b/KernelLand/Kernel/drvutil_disk.c @@ -49,6 +49,7 @@ Uint64 DrvUtil_ReadBlock(Uint64 Start, Uint64 Length, void *Buffer, else { num = Length / BlockSize; tailings = Length % BlockSize; + leading = 0; } // Read central blocks @@ -57,6 +58,7 @@ Uint64 DrvUtil_ReadBlock(Uint64 Start, Uint64 Length, void *Buffer, LOG("Reading %i blocks", num); ret = ReadBlocks(block, num, Buffer, Argument); if(ret != num ) { + LOG("Incomplete read (%i != %i)", ret, num); LEAVE('X', leading + ret * BlockSize); return leading + ret * BlockSize; }