From b7a7076354b0837c6da080270bd0d6da2dfce75b Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Thu, 21 Apr 2022 01:29:22 -0400 Subject: [PATCH] exported.sh: Work around DJGPP shell redirection bug. In DJGPP's bash port, it seems that redirections of the form /absolute/path/to/program 3>&- result in the file descriptor being closed for the whole shell, rather than just for the one command as expected. Since some of the configure substitutions into exported.sh can be absolute paths, this causes failures. Using a different command syntax avoids this problem. For example, { /absolute/path/to/program; } 3>&- appears to work as expected. Adjust the exported.sh.in snippet to do just that. There is still one redirection error message printed to stderr by DJGPP bash but it appears spurious at first glance. All the redirections now appear to be working properly and the script output looks good. --- snippet/exported.sh.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/snippet/exported.sh.in b/snippet/exported.sh.in index f9d3c40..f5ef7b0 100644 --- a/snippet/exported.sh.in +++ b/snippet/exported.sh.in @@ -41,13 +41,13 @@ case $# in *) exec 4>&1 eval_cmd=`exec 3>&1 - { @NM@ $OBJS 3>&- + { { @NM@ $OBJS; } 3>&- echo "(exit $?) || exit $?" >&3 - } | { @GLOBAL_SYMBOL_PIPE@ 3>&- + } | { { @GLOBAL_SYMBOL_PIPE@; } 3>&- echo "(exit $?) || exit $?" >&3 - } | { @SED@ 's/^.* //' 3>&- + } | { { @SED@ 's/^.* //'; } 3>&- echo "(exit $?) || exit $?" >&3 - } | { LC_ALL=C sort -u 3>&- + } | { { LC_ALL=C sort -u; } 3>&- echo "(exit $?) || exit $?" >&3 } >&4` exec 4>&- -- 2.43.2