diff options
| author | KATO Takenori <kato@FreeBSD.org> | 1997-03-16 10:57:54 +0000 |
|---|---|---|
| committer | KATO Takenori <kato@FreeBSD.org> | 1997-03-16 10:57:54 +0000 |
| commit | 3abc0e5cd97da8eaee6eee0ad3cde7da3b756137 (patch) | |
| tree | 46e0d79fcd71614223003aa5826e8c000ce7084c | |
| parent | d380dd6d8e5bb9d875f8bb989ffd11a8a9bdc49b (diff) | |
Notes
| -rw-r--r-- | sys/pc98/boot/biosboot/sys.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/pc98/boot/biosboot/sys.c b/sys/pc98/boot/biosboot/sys.c index 0a82fd9677fc..410d08acf1a6 100644 --- a/sys/pc98/boot/biosboot/sys.c +++ b/sys/pc98/boot/biosboot/sys.c @@ -24,7 +24,7 @@ * the rights to redistribute these changes. * * from: Mach, Revision 2.2 92/04/04 11:36:34 rpd - * $Id$ + * $Id: sys.c,v 1.10 1997/02/22 09:43:10 peter Exp $ */ /* @@ -77,12 +77,14 @@ read(char *buffer, int count) { int logno, off, size; int cnt2, bnum2; + struct fs *fs_copy; - while (count) { - off = blkoff(fs, poff); - logno = lblkno(fs, poff); - cnt2 = size = blksize(fs, &inode, logno); - bnum2 = fsbtodb(fs, block_map(logno)) + boff; + while (count > 0 && poff < inode.i_size) { + fs_copy = fs; + off = blkoff(fs_copy, poff); + logno = lblkno(fs_copy, poff); + cnt2 = size = blksize(fs_copy, &inode, logno); + bnum2 = fsbtodb(fs_copy, block_map(logno)) + boff; if ( (!off) && (size <= count)) { devread(buffer, bnum2, cnt2); } else { |
