Skip to content

Commit 986b8db

Browse files
committed
Implicitly support the /dev/fd symlink and friends
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 MSYS2 and Cygwin therefore create this symlink (together with the `stdin`, `stdout` and `stderr` ones) upon start-up. This strategy is a bit incompatible with Git for Windows, which wants to install the pseudo root into a write-protected area, concretely in `C:\Program Files\Git`. This strategy is _also_ incompatible with the idea of providing MinGit as a `.zip` file (because there is no standard way to represent symlinks in `.zip` files, and besides, older Windows versions would potentially lack support for them anyway). Let's side-step this completely by creating those symlinks implicitly, similar to the way `/dev/` is populated with special devices. The diff is misleadlingly large due to the re-generated `devices.cc`. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent bc26b73 commit 986b8db

File tree

7 files changed

+879
-707
lines changed

7 files changed

+879
-707
lines changed

winsup/cygwin/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ DLL_FILES= \
230230
fhandler_console.cc \
231231
fhandler_cygdrive.cc \
232232
fhandler_dev.cc \
233+
fhandler_dev_fd.cc \
233234
fhandler_disk_file.cc \
234235
fhandler_dsp.cc \
235236
fhandler_fifo.cc \

0 commit comments

Comments
 (0)