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
2ca77c355d
commit
f79981aca8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=116432
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user