summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-12-01 12:26:24 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-12-01 12:26:24 +0000
commit815cf483683f37c16b0cc9f04916ac0435b423b7 (patch)
tree82b1a4c93cf21815682809498ae85eb19986351a
parent94b39fe1959c7ce038c2aab598340eadf1441b98 (diff)
downloadzsh-815cf483683f37c16b0cc9f04916ac0435b423b7.tar.gz
zsh-815cf483683f37c16b0cc9f04916ac0435b423b7.tar.xz
zsh-815cf483683f37c16b0cc9f04916ac0435b423b7.zip
26103: use FIFOs rather than FD files for process substititution on Cygwin
-rw-r--r--ChangeLog6
-rw-r--r--configure.ac15
2 files changed, 19 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index f4b95236d..59d69a5a6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-12-01  Peter Stephenson  <pws@csr.com>
+
+	* (with some help from Peter A. Castro): 26103: configure.ac:
+	FIFOs seem to be more reliable than per-process FD files for
+	process substitution on current Cygwin.
+
 2008-11-27  Peter Stephenson  <pws@csr.com>
 
 	* 26095: Src/utils.c: failed to compile if TIOCGWINSZ wasn't
diff --git a/configure.ac b/configure.ac
index f68b1b9bc..762b23130 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1787,9 +1787,17 @@ dnl be good enough.
 AH_TEMPLATE([PATH_DEV_FD],
 [Define to the path of the /dev/fd filesystem.])
 AC_CACHE_CHECK(for /dev/fd filesystem, zsh_cv_sys_path_dev_fd,
+[if test "$host_os" = cygwin; then
+dnl In current (2008/12/01) versions of Cygwin these are present but don't
+dnl seem to work smoothly for process substitution; no great surprise
+dnl since getting processes to work at all on Cygwin is a big challenge.
+dnl We'll rely on FIFOs, since they do what we need.
+zsh_cv_sys_path_dev_fd=no
+else
 [for zsh_cv_sys_path_dev_fd in /proc/self/fd /dev/fd no; do
    test x`echo ok|(exec 3<&0; cat $zsh_cv_sys_path_dev_fd/3 2>/dev/null;)` = xok && break
- done])
+ done]
+fi])
 if test x$zsh_cv_sys_path_dev_fd != xno; then
   AC_DEFINE_UNQUOTED(PATH_DEV_FD, "$zsh_cv_sys_path_dev_fd")
 fi
@@ -1954,10 +1962,13 @@ fi
 dnl -----------
 dnl named FIFOs
 dnl -----------
+dnl
+dnl Named FIFOs work well enough on recent versions of Cygwin
+dnl to provide what we want.  Simply enable them.
 AC_CACHE_CHECK(if named FIFOs work,
 zsh_cv_sys_fifo,
 [if test "$host_os" = cygwin; then
-zsh_cv_sys_fifo=no
+zsh_cv_sys_fifo=yes
 else
 AC_TRY_RUN([
 #include <fcntl.h>