4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-09 02:29:07 +08:00
Takashi Yano c7fe29f5cb Cygwin: pipe: Restore blocking mode of read pipe on close()/raw_read()
If a cygwin app is executed from a non-cygwin app and the cygwin
app exits, the read pipe remains in the non-blocking mode because
of the commit fc691d0246b9. Due to this behaviour, the non-cygwin
app cannot read the pipe correctly after that. Similarly, if a
non-cygwin app is executed from a cygwin app and the non-cygwin
app exits, the read pipe remains in the blocking mode. With this
patch, the blocking mode of the read pipe is stored into a variable
was_blocking_read_pipe on set_pipe_non_blocking() when the cygwin
app starts and restored on close(). In addition, the pipe mode is
set to non-blocking mode in raw_read() if the mode is blocking
mode by referring the variable is_blocking_read_pipe as well.
is_blocking_read_pipe is a member of fhandler_pipe class and is set
by set_pipe_non_blocking(), so if other process sets the pipe mode
to blocking mode, the current process cannot know the pipe is
blocking mode. Therefore, is_blocking_read_pipe is also set on the
signal __SIGNONCYGCHLD, which is sent to the process group when
non-cygwin app is started.

Addresses: https://github.com/git-for-windows/git/issues/5115
Fixes: fc691d0246b9 ("Cygwin: pipe: Make sure to set read pipe non-blocking for cygwin apps.");
Reported-by: isaacag, Johannes Schindelin <Johannes.Schindelin@gmx.de>
Reviewed-by: Corinna Vinschen <corinna@vinschen.de>, Ken Brown <kbrown@cornell.edu>
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
2024-09-17 22:01:45 +09:00
..
2024-08-25 11:59:29 +02:00
2022-08-04 20:54:09 +02:00
2024-02-21 20:00:59 +01:00
2021-11-10 20:16:15 -05:00
2022-08-04 22:13:59 +02:00
2023-02-25 16:12:51 +01:00
2022-08-04 22:13:59 +02:00
2024-01-15 12:52:56 +01:00
2024-01-23 09:49:02 +01:00
2023-11-05 17:01:43 +01:00
2022-08-04 15:16:48 +02:00
2022-05-29 17:45:52 -04:00
2021-06-26 15:24:27 +01:00
2022-08-04 22:13:59 +02:00
2022-05-29 17:45:52 -04:00
2022-08-04 22:13:59 +02:00
2022-05-29 17:45:52 -04:00
2022-08-04 22:13:59 +02:00
2022-05-29 17:45:52 -04:00
2024-01-15 12:52:56 +01:00
2022-08-04 22:13:59 +02:00
2024-09-12 10:57:24 -04:00
2022-08-04 22:13:59 +02:00