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
This commit is contained in:
parent
ce17880650
commit
d25c683ad5
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user