ref: 8456751e9b7df44657bd36b9fed1999fb3b99b8a
parent: 2ffda6b58c2e5fc7993066ca323898149e66495f
author: Michael Forney <[email protected]>
date: Sun Jan 30 20:16:12 EST 2022
fix readblk with short read
--- a/blk.c
+++ b/blk.c
@@ -70,10 +70,10 @@
assert(bp != -1);
if((b = malloc(sizeof(Blk))) == nil)
return nil;
- off = bp;
+ off = 0;
rem = Blksz;
while(rem != 0){
- n = pread(fs->fd, b->buf, rem, off);
+ n = pread(fs->fd, b->buf+off, rem, bp+off);
if(n <= 0){
free(b);
return nil;