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:
yar 2003-06-16 07:50:17 +00:00
parent 35bf27413a
commit 6bc6b7ee8b
2 changed files with 8 additions and 2 deletions

View File

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

View File

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