summaryrefslogtreecommitdiffstats
path: root/sys/isa
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2003-06-16 07:50:17 +0000
committeryar <yar@FreeBSD.org>2003-06-16 07:50:17 +0000
commit6bc6b7ee8b511b2c9828fd11f4fc416b636ee156 (patch)
treea3158710994b65d9904886673d017e5de25b0725 /sys/isa
parent35bf27413a821adfc5330667d922672f4439071a (diff)
downloadFreeBSD-src-6bc6b7ee8b511b2c9828fd11f4fc416b636ee156.zip
FreeBSD-src-6bc6b7ee8b511b2c9828fd11f4fc416b636ee156.tar.gz
If in non-blocking mode, return EAGAIN instead of ENXIO
on an I/O attempt. This is needed for consistency with the concept of the half-opened state of fdc(4). PR: kern/52338
Diffstat (limited to 'sys/isa')
-rw-r--r--sys/isa/fd.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/isa/fd.c b/sys/isa/fd.c
index 2d835a0..7599392 100644
--- a/sys/isa/fd.c
+++ b/sys/isa/fd.c
@@ -1671,7 +1671,10 @@ fdstrategy(struct bio *bp)
fdc = fd->fdc;
bp->bio_resid = bp->bio_bcount;
if (fd->type == FDT_NONE || fd->ft == 0) {
- bp->bio_error = ENXIO;
+ if (fd->type != FDT_NONE && (fd->flags & FD_NONBLOCK))
+ bp->bio_error = EAGAIN;
+ else
+ bp->bio_error = ENXIO;
bp->bio_flags |= BIO_ERROR;
goto bad;
}
OpenPOWER on IntegriCloud