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
This commit is contained in:
parent
35bf27413a
commit
6bc6b7ee8b
@ -1671,6 +1671,9 @@ fdstrategy(struct bio *bp)
|
||||
fdc = fd->fdc;
|
||||
bp->bio_resid = bp->bio_bcount;
|
||||
if (fd->type == FDT_NONE || fd->ft == 0) {
|
||||
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;
|
||||
|
@ -1671,6 +1671,9 @@ fdstrategy(struct bio *bp)
|
||||
fdc = fd->fdc;
|
||||
bp->bio_resid = bp->bio_bcount;
|
||||
if (fd->type == FDT_NONE || fd->ft == 0) {
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user