diff options
author | alfred <alfred@FreeBSD.org> | 2001-11-08 10:28:32 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2001-11-08 10:28:32 +0000 |
commit | d08d3afdaa960644d8f0320d87bc89c1827f9276 (patch) | |
tree | 0d49d14c404c3a8a7b7a7faab9ff8c8097b5bb0e /sys/fs/fifofs | |
parent | 8cf42b482a9aa3f9ec41071c44bc18a0ea425abf (diff) | |
download | FreeBSD-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/fifofs')
-rw-r--r-- | sys/fs/fifofs/fifo_vnops.c | 5 |
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; |