autoconf-patches
[Top][All Lists]
Advanced

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

Re: [PATCH 1/4] DJGPP fix: Do not redirect standard input in configure s


From: Eli Zaretskii
Subject: Re: [PATCH 1/4] DJGPP fix: Do not redirect standard input in configure scripts.
Date: Mon, 14 Sep 2009 20:56:32 +0300

> Date: Mon, 14 Sep 2009 05:46:22 -0600
> From: Eric Blake <address@hidden>
> 
> > -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.)




reply via email to

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