Fix select()/kqueue() bug with pipe()s
authorMatthew Dillon <dillon@apollo.backplane.com>
Fri, 19 Nov 2021 18:10:29 +0000 (10:10 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Fri, 19 Nov 2021 18:10:29 +0000 (10:10 -0800)
commit3e6cd71a300e70d8644d281b53a7f30d1d5c4bce
tree49d5ae94e079d52513f53223e21c5ae27cf9c691
parent5e151005feba13e39d0ea3b88c186375f755e0d8
Fix select()/kqueue() bug with pipe()s

* This causes select() / kqueue() was not returning a writable condition
  on a pipe() whos other end was closed early.

  If a select/kqueue test is performed prior to the other end closing,
  then future calls will later properly detect when the other end closes.

* Should fix numerous niggling issues, including csh sometimes failing
  to recognize early exits of children.

Reported-by: tmunro, deef, bug #3307
sys/kern/sys_pipe.c