Mail Archives: djgpp-workers/2009/09/14/13:57:05
> Date: Mon, 14 Sep 2009 05:46:22 -0600
> From: Eric Blake <ebb9 AT byu DOT net>
>
> > -exec AS_ORIGINAL_STDIN_FD<&0 </dev/null AS_MESSAGE_FD>&1
> > +test -n "$DJGPP" || exec AS_ORIGINAL_STDIN_FD<&0 </dev/null
> > +exec AS_MESSAGE_FD>&1
>
> Since /dev/null is faked as a regular file, is there some better thing we
> can use to achieve the same effect, rather than disabling the redirection
> entirely? Or, put another way, is NUL always available on DJGPP?
NUL is available on DJGPP, but I don't think this will help. We are
talking about the following line in the configure script, right?
exec 7<&0 </dev/null 6>&1
If so, then even replacing /dev/null with NUL (which DJGPP does
automatically under the hood, btw) still causes Bash to barf thusly:
configure: redirection error: Bad file descriptor (EBADF)
So there's some other factor at work here, not /dev/null.
AFAIU, this redirection is for the rare situation that the script
somehow invokes interactive commands, which will then wait for an
EOF. So I think replacing it with just
exec 6>&1
is good enough (I did that in gdb/config/djgpp/config.sed for GDB),
and I believe the proposed patch does just that.
(If I'm barking up the wrong tree, please tell what does this code
generate in the configure script, and I will look again.)
- Raw text -