From 4ec08891a005c040da5bf7c38ae44f932d29bd77 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 21 Feb 2022 14:36:37 +0100 Subject: Cygwin: 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 Cygwin therefore creates this symlink (together with the `stdin`, `stdout` and `stderr` ones) upon start-up. This strategy is incompatible with the idea of providing a subset of Cygwin in 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). That type of `.zip` file is what Git for Windows wants to use, though, bundling a minimal subset for third-party applications in MinGit (see https://github.com/git-for-windows/git/wiki/MinGit for details). Let's side-step this problem completely by creating those symlinks implicitly, similar to the way `/dev/` is populated with special devices. Signed-off-by: Johannes Schindelin --- winsup/cygwin/dtable.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'winsup/cygwin/dtable.cc') diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc index 44d6e11..474c470 100644 --- a/winsup/cygwin/dtable.cc +++ b/winsup/cygwin/dtable.cc @@ -582,6 +582,9 @@ fh_alloc (path_conv& pc) case FH_DEV: fh = cnew (fhandler_dev); break; + case FH_DEV_FD: + fh = cnew (fhandler_dev_fd); + break; case FH_CYGDRIVE: fh = cnew (fhandler_cygdrive); break; -- cgit v1.1