Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: Avoid \e in C code; building on Solaris 11



Bart Schaefer wrote:
>     /dev/fd tests are being skipped because it doesn't detect /dev/fd.
>     That test is: echo ok|(exec 3<&0; cat /dev/fd/3 2>/dev/null;)
>
> (This refers to [2]configure.ac, not Test/*)

Yes, sorry. However it was something that was only apparent when running
test cases because it caused some to get skipped.

It occurred to me that /bin/sh on Solaris 11 is ksh 93 and that test
consistently doesn't work with ksh (88 or 93). The same applies with
ksh93 on Linux.

> This is testing that /dev/fd/ entries are created when new descriptors are
> created.  The commit log says "work around /dev/fd problem on FreeBSD":
> +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.

While that talks about FreeBSD 5, that isn't a situation that has
changed at all. Annoyingly, most package builds take place in a jail
where fdescfs is not mounted so PATH_DEV_FD is probably undefined for
most users on FreeBSD even if they mount fdescfs.

Just doing test -e on /dev/fd/3 gives the same results as the existing
test on FreeBSD both with and without fdescfs. Do you see a problem with
this approach?

Oliver

diff --git a/configure.ac b/configure.ac
index a42758bf3..2871dcb7c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2016,7 +2016,7 @@ 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|(exec 3<&0; cat $zsh_cv_sys_path_dev_fd/3 2>/dev/null;)` = xok && break
+   (exec 3<&0; test -e $zsh_cv_sys_path_dev_fd/3;) && break
  done])
 if test x$zsh_cv_sys_path_dev_fd != xno; then
   AC_DEFINE_UNQUOTED(PATH_DEV_FD, "$zsh_cv_sys_path_dev_fd")




Messages sorted by: Reverse Date, Date, Thread, Author