summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-07 15:54:42 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-08-07 15:54:42 +0000
commit7e2a1c8f24e10b81fc3113260fb1404ee65c7685 (patch)
tree210b93f80324708c4e260672a82b6b27995bff01 /sys
parent7de9eff104e6d6de39cdebb8065a679c44dbc532 (diff)
correct b_resid handling; pointed out by banshee@gabriella.abattoir.com
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/i386/isa/fd.c7
-rw-r--r--sys/dev/isa/fd.c7
2 files changed, 6 insertions, 8 deletions
diff --git a/sys/arch/i386/isa/fd.c b/sys/arch/i386/isa/fd.c
index 065e19ccfe9..4d2a8d9fe9a 100644
--- a/sys/arch/i386/isa/fd.c
+++ b/sys/arch/i386/isa/fd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fd.c,v 1.18 1996/06/20 07:51:37 downsj Exp $ */
+/* $OpenBSD: fd.c,v 1.19 1996/08/07 15:54:41 deraadt Exp $ */
/* $NetBSD: fd.c,v 1.90 1996/05/12 23:12:03 mycroft Exp $ */
/*-
@@ -528,11 +528,9 @@ fdstrategy(bp)
if (bp->b_blkno + sz > fd->sc_type->size) {
sz = fd->sc_type->size - bp->b_blkno;
- if (sz == 0) {
+ if (sz == 0)
/* If exactly at end of disk, return EOF. */
- bp->b_resid = bp->b_bcount;
goto done;
- }
if (sz < 0) {
/* If past end of disk, return EINVAL. */
bp->b_error = EINVAL;
@@ -571,6 +569,7 @@ bad:
bp->b_flags |= B_ERROR;
done:
/* Toss transfer; we're done early. */
+ bp->b_resid = bp->b_bcount;
biodone(bp);
}
diff --git a/sys/dev/isa/fd.c b/sys/dev/isa/fd.c
index 065e19ccfe9..4d2a8d9fe9a 100644
--- a/sys/dev/isa/fd.c
+++ b/sys/dev/isa/fd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fd.c,v 1.18 1996/06/20 07:51:37 downsj Exp $ */
+/* $OpenBSD: fd.c,v 1.19 1996/08/07 15:54:41 deraadt Exp $ */
/* $NetBSD: fd.c,v 1.90 1996/05/12 23:12:03 mycroft Exp $ */
/*-
@@ -528,11 +528,9 @@ fdstrategy(bp)
if (bp->b_blkno + sz > fd->sc_type->size) {
sz = fd->sc_type->size - bp->b_blkno;
- if (sz == 0) {
+ if (sz == 0)
/* If exactly at end of disk, return EOF. */
- bp->b_resid = bp->b_bcount;
goto done;
- }
if (sz < 0) {
/* If past end of disk, return EINVAL. */
bp->b_error = EINVAL;
@@ -571,6 +569,7 @@ bad:
bp->b_flags |= B_ERROR;
done:
/* Toss transfer; we're done early. */
+ bp->b_resid = bp->b_bcount;
biodone(bp);
}