]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tap: close fd 3 before invoking the test script
authorRichard Hansen <rhansen@rhansen.org>
Mon, 3 Feb 2025 23:26:55 +0000 (18:26 -0500)
committerKarl Berry <karl@freefriends.org>
Sun, 23 Feb 2025 01:36:59 +0000 (17:36 -0800)
* lib/tap-driver.sh: Close file descriptor 3 before invoking the test
script to avoid potential conflicts with the test script.

lib/tap-driver.sh

index 75e7676052fc7529a7c78bee52a46adc7ffd015e..0bd79a6d420f9807f5093a7ab38d59ab6de03dac 100755 (executable)
@@ -23,7 +23,7 @@
 # bugs to <bug-automake@gnu.org> or send patches to
 # <automake-patches@gnu.org>.
 
-scriptversion=2024-12-03.03; # UTC
+scriptversion=2025-02-03.01; # UTC
 
 # Make unconditional expansion of undefined variables an error.  This
 # helps a lot in preventing typo-related bugs.
@@ -144,7 +144,7 @@ fi
     else
       exec 2>&3
     fi
-    "$@"
+    "$@" 3>&-
     echo $?
   ) | LC_ALL=C ${AM_TAP_AWK-awk} \
         -v me="$me" \
@@ -638,8 +638,6 @@ exit 0
 
 } # End of "BEGIN" block.
 '
-
-# TODO: document that we consume the file descriptor 3 :-(
 } 3>"$log_file"
 
 test $? -eq 0 || fatal "I/O or internal error"