chiark / gitweb /
bin/mdw-build: Close our file descriptors when running subcommands.
[profile] / bin / mdw-build
index 7c825243ffbcea5488c4b85c21f83381ca84af24..7f32c4f3ebd176025b6806e3f7de187b594214d3 100755 (executable)
@@ -224,14 +224,14 @@ assign () {
 
 runx () {
   notify 2 "+++ $*"
-  "$@" 2>&3 || fail "$1: exit $?"
+  "$@" 2>&3 3>&- 4>&- 5>&- || fail "$1: exit $?"
 }
 
 run () { runx "$@" >&3; }
 
 yesno () {
   echo -n "(test $*)" >&4
-  if "$@" >&4 2>&4; then
+  if "$@" >&4 2>&4 3>&- 4>&- 5>&-; then
     echo "(yes)" >&4
     echo yes
   else