[PATCH] Cygwin: pty: Encapsulate pty code in tty::setpgid().

2022-02-21 Thread Takashi Yano
- This patch hides complex pty codes in tty::setpgid() to transfer input into the class fhandler_pty_slave by encapsulating it. --- winsup/cygwin/fhandler.h | 2 ++ winsup/cygwin/fhandler_tty.cc | 51 winsup/cygwin/tty.cc | 62

[PATCH] Cygwin: pty, console: Fix handle leak which occurs on exec() error.

2022-02-21 Thread Takashi Yano
- This patch fixes the handle leak which occurs when exec() fails with an error. The duplicated handles will be closed when the exec'ed process is terminated. However, if exec() fails, the code path does not reach to the code closing the duplicated handles. To implement this fix more

[PATCH 1/2] Implicitly support the /dev/fd symlink and friends

2022-02-21 Thread Johannes Schindelin
Bash has a very convenient feature that is called process substitution (e.g. `diff -u <(seq 0 10) <(seq 1 11)`). To make this work, Bash requires the `/dev/fd` symlink to exist, and Cygwin therefore creates this symlink (together with the `stdin`, `stdout` and `stderr` ones) upon start-up. This

[PATCH 0/2] Provide virtual /dev/fd and /dev/{stdin,stdout,stderr} symlinks

2022-02-21 Thread Johannes Schindelin
These symbolic links are crucial e.g. to support process substitution (Bash's very nice `<(SOME-COMMAND)` feature). For various reasons, it is a bit cumbersome (or impossible) to generate these symbolic links in all circumstances where Git for Windows wants to use its close fork of the Cygwin