Kernel - Fixed bug in DrvUtil_Disk causing bad return values
authorJohn Hodge <[email protected]>
Sat, 14 Jul 2012 12:27:00 +0000 (20:27 +0800)
committerJohn Hodge <[email protected]>
Sat, 14 Jul 2012 12:27:00 +0000 (20:27 +0800)
KernelLand/Kernel/drvutil_disk.c

index db4d631..49dc7b2 100644 (file)
@@ -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;
                }

UCC git Repository :: git.ucc.asn.au