summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authoralfred <alfred@FreeBSD.org>2001-11-08 10:28:32 +0000
committeralfred <alfred@FreeBSD.org>2001-11-08 10:28:32 +0000
commitd08d3afdaa960644d8f0320d87bc89c1827f9276 (patch)
tree0d49d14c404c3a8a7b7a7faab9ff8c8097b5bb0e /sys/fs
parent8cf42b482a9aa3f9ec41071c44bc18a0ea425abf (diff)
downloadFreeBSD-src-d08d3afdaa960644d8f0320d87bc89c1827f9276.zip
FreeBSD-src-d08d3afdaa960644d8f0320d87bc89c1827f9276.tar.gz
Switch behavior of fifos to more closely match what goes on in other OSes.
Basically FIFOs become a real pain to abuse as a rendevous point without this change because you can't really select(2) on them because they always return ready even though there is no writer (to signal EOF). Obtained from: BSD/os
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/fifofs/fifo_vnops.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/fs/fifofs/fifo_vnops.c b/sys/fs/fifofs/fifo_vnops.c
index baddfa4..e69532e 100644
--- a/sys/fs/fifofs/fifo_vnops.c
+++ b/sys/fs/fifofs/fifo_vnops.c
@@ -284,6 +284,11 @@ fifo_read(ap)
VOP_UNLOCK(ap->a_vp, 0, td);
error = soreceive(rso, (struct sockaddr **)0, uio, (struct mbuf **)0,
(struct mbuf **)0, (int *)0);
+ /*
+ * Clear EOF indication after first such return.
+ */
+ if (uio->uio_resid == startresid)
+ rso->so_state &= ~SS_CANTRCVMORE;
vn_lock(ap->a_vp, LK_EXCLUSIVE | LK_RETRY, td);
if (ap->a_ioflag & IO_NDELAY)
rso->so_state &= ~SS_NBIO;
OpenPOWER on IntegriCloud