summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Lockert <tholo@cvs.openbsd.org>1996-11-04 03:31:55 +0000
committerThorsten Lockert <tholo@cvs.openbsd.org>1996-11-04 03:31:55 +0000
commitb56f2339a1db1df97ec6a71c06b4825a7cf6c267 (patch)
treeba334c74573fc3c49218cbccdca3b494397cab5c
parent79451bbeac53e1c4dae0cccf2f20bb21c4bc260b (diff)
We should return 0 on non-blocking read from FIFO with no writers
-rw-r--r--sys/miscfs/fifofs/fifo_vnops.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/miscfs/fifofs/fifo_vnops.c b/sys/miscfs/fifofs/fifo_vnops.c
index dfd597fdde9..8b45763c8c3 100644
--- a/sys/miscfs/fifofs/fifo_vnops.c
+++ b/sys/miscfs/fifofs/fifo_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fifo_vnops.c,v 1.3 1996/04/21 22:28:10 deraadt Exp $ */
+/* $OpenBSD: fifo_vnops.c,v 1.4 1996/11/04 03:31:54 tholo Exp $ */
/* $NetBSD: fifo_vnops.c,v 1.18 1996/03/16 23:52:42 christos Exp $ */
/*
@@ -266,6 +266,9 @@ fifo_read(v)
rso->so_state &= ~SS_CANTRCVMORE;
if (ap->a_ioflag & IO_NDELAY)
rso->so_state &= ~SS_NBIO;
+ if ((ap->a_ioflag & IO_NDELAY) && error == EWOULDBLOCK &&
+ ap->a_vp->v_fifoinfo->fi_writers == 0)
+ error = 0;
return (error);
}