From d08d3afdaa960644d8f0320d87bc89c1827f9276 Mon Sep 17 00:00:00 2001 From: alfred Date: Thu, 8 Nov 2001 10:28:32 +0000 Subject: [PATCH] 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 --- sys/fs/fifofs/fifo_vnops.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sys/fs/fifofs/fifo_vnops.c b/sys/fs/fifofs/fifo_vnops.c index baddfa4b5f7..e69532e99b3 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; -- 2.45.0