bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Fix /dev/fd detection on FreeBSD


From: Roy Marples
Subject: [PATCH] Fix /dev/fd detection on FreeBSD
Date: Sun, 31 Dec 2006 12:12:29 +0000

Chet Ramey wrote:

> The configure test for /dev/fd succeeds on FreeBSD
> (testing for /dev/fd/3 after `exec 3</dev/null'), when it should fail.
> It should only succeed if you have the fdescfs file system mounted.
> The problem is that `configure' concludes that /bin/sh's $LINENO
> handling is deficient and uses bash to execute the configure script.
> The bash builtin `test' interprets pathnames beginning with /dev/fd
> internally, using fstat on the appropriate file descriptor, so this
> test succeeds.
>
> This should affect only FreeBSD 5 and 6.
> 
> You can fix this in a couple of ways:  Edit config.h to #undef
> HAVE_DEV_FD after configure finishes, or set `CONFIG_SHELL=/bin/sh'
> before running configure.
>
> I will need to figure out a better test for future versions.

Attached is a patch to aclocal.m4 (and the auto-generated
configure) that finds the test binary and runs that directly for this
test only.

Fixes the described issue nicely on Gentoo/FreeBSD-6

We also change the test to -e instead of -r due to Gentoo Bug
http://bugs.gentoo.org/show_bug.cgi?id=131875

Thanks

Roy

Attachment: bash-3.2-dev-fd-test.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]