Commit d750786
Cygwin: pipe: Add workaround for native ninja
Native (non-cygwin) ninja creates pipe with size == 0, and starts
cygwin process with that pipe. This causes infinite loop in the
fhandler_fifo_pipe::raw_write(). Ideally, the pipe implementation
in cygwin could work even with pipe size == 0, however, it seems
impossible due to:
(1) select() does not work for that pipe because PeekNamedPipe()
always returns 0. Read side is ready to read only when the
write side is about to write, but there is no way to know that.
(2) The cause of the problem:
https://cygwin.com/pipermail/cygwin/2025-January/257143.html
cannot be avoidable. To avoid CancelIo() problem, the patch
https://cygwin.com/pipermail/cygwin-patches/2025q1/013451.html
restricts the data size less than the current pipe space.
However, if pipe size is zero this is impossible.
This patch adds just a workaround for native ninja that avoid
infinite loop in raw_write().
Addresses: msys2/msys2-runtime#270
Reported-by: Christoph Reiter <[email protected]>
Co-authored-by: Johannes Schindelin <[email protected]>
Reviewed-by: Corinna Vinschen <[email protected]>
Signed-off-by: Takashi Yano <[email protected]>
(cherry picked from commit 236e865)1 parent 00e7a89 commit d750786
2 files changed
+8
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
455 | 455 | | |
456 | 456 | | |
457 | 457 | | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
458 | 463 | | |
459 | 464 | | |
460 | 465 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
670 | 670 | | |
671 | 671 | | |
672 | 672 | | |
673 | | - | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
674 | 676 | | |
675 | 677 | | |
676 | 678 | | |
| |||
0 commit comments