Created attachment 189130 [details]
patch for filt_piperead
When connecting as a new reader to a named pipe after all previous writers have disconnected, EVFILT_READ currently returns EV_EOF.
poll(2) was fixed a while ago so that it won't return POLLHUP in this case (at least since r238936). The attached patch brings the logic in EVFILT_READ in sync with poll(2) again.
I wonder why the other side of the pipe is also checked in EVFILT_READ. Wouldn't it be enough to just check for EOF on the readers side? This would be consistent with sockets for example (where just SBS_CANTRCVMORE leads to EV_EOF).
I've also attached a small patch to the pipepoll.c regression test that can be used to reproduce the issue.
Created attachment 189131 [details]
patch to pipepoll.c demonstrating the issue