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:
Yaroslav Tykhiy 2003-06-16 07:50:17 +00:00
parent 2ca77c355d
commit f79981aca8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=116432
2 changed files with 8 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}