diff --git a/sys/kern/sys_pipe.c b/sys/kern/sys_pipe.c index a81c9de..e68a9be 100644 --- a/sys/kern/sys_pipe.c +++ b/sys/kern/sys_pipe.c @@ -1791,7 +1791,9 @@ filt_piperead(struct knote *kn, long hint) if ((kn->kn_data == 0) && (rpipe->pipe_state & PIPE_DIRECTW)) kn->kn_data = rpipe->pipe_map.cnt; - if ((rpipe->pipe_state & PIPE_EOF) || + if ((kn->kn_flags & (EV_CLEAR | EV_EOF)) == (EV_CLEAR | EV_EOF)) { + kn->kn_flags &= ~EV_EOF; + } else if ((rpipe->pipe_state & PIPE_EOF) || wpipe->pipe_present != PIPE_ACTIVE || (wpipe->pipe_state & PIPE_EOF)) { kn->kn_flags |= EV_EOF;