summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-10-30 16:57:05 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-10-30 16:57:05 +0000
commit4dae429ba3bb5d4f02fe2ce39b950f8355d529d2 (patch)
tree80d8fae2379125f398a18658bf355380a7a978cb
parent53a862dec52817c2e5f9cbe6d11077fed971c231 (diff)
downloadzsh-4dae429ba3bb5d4f02fe2ce39b950f8355d529d2.tar.gz
zsh-4dae429ba3bb5d4f02fe2ce39b950f8355d529d2.tar.xz
zsh-4dae429ba3bb5d4f02fe2ce39b950f8355d529d2.zip
21954: work around /dev/fd problem on FreeBSD
-rw-r--r--configure.ac7
1 files changed, 6 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 84a9d5b99..b0f7c6cef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1599,11 +1599,16 @@ AC_DEFINE_UNQUOTED(DEFAULT_PATH, "$zsh_cv_cs_path",
 dnl ----------------------------
 dnl CHECK FOR /dev/fd FILESYSTEM
 dnl ----------------------------
+dnl FreeBSD 5 only supports /dev/fd/0 to /dev/fd/2 without mounting
+dnl a special file system.  As zsh needs arbitrary /dev/fd (typically
+dnl >10) for its own use, we need to make sure higher fd's are available.
+dnl Since we're using the shell, we're restricted to 0 to 9 but 3 should
+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,
 [for zsh_cv_sys_path_dev_fd in /proc/self/fd /dev/fd no; do
-   test x`echo ok|cat $zsh_cv_sys_path_dev_fd/0 2>/dev/null` = xok && break
+   test x`echo ok|(exec 3<&0; cat $zsh_cv_sys_path_dev_fd/3 2>/dev/null;)` = xok && break
  done])
 if test $zsh_cv_sys_path_dev_fd != no; then
   AC_DEFINE_UNQUOTED(PATH_DEV_FD, "$zsh_cv_sys_path_dev_fd")