From 12e092632919cf9089a97a233715d7fee10e4836 Mon Sep 17 00:00:00 2001 Message-Id: <12e092632919cf9089a97a233715d7fee10e4836.1715727568.git.mdw@distorted.org.uk> From: Mark Wooding Date: Sat, 1 Dec 2012 23:24:09 +0000 Subject: [PATCH] hush.in: Close extraneous file descriptors when running the command. Organization: Straylight/Edgeware From: Mark Wooding Otherwise, if it forks a daemon or something then we end up hanging until the daemon stops. --- debian/changelog | 7 +++++++ hush.in | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index 106b4ab..ca7d1a7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +nsict-utils (1.2.8.2) experimental; urgency=low + + * hush: Close file descriptors around the command, so that we don't wait + for daemons to exit. + + -- Mark Wooding Sat, 01 Dec 2012 23:25:41 +0000 + nsict-utils (1.2.8.1) experimental; urgency=low * hush.8: Fix some misformatting. diff --git a/hush.in b/hush.in index 4b3b751..4359527 100755 --- a/hush.in +++ b/hush.in @@ -146,7 +146,7 @@ EOF ## we write that to another pipe (fd 5) and pick it out using command ## substitution. rc=$( - { { { { set +e; $lbuf "$cmd" "$@"; echo $? >&5; } | + { { { { set +e; $lbuf "$cmd" "$@" 3>&- 4>&- 5>&-; echo $? >&5; } | while IFS= read line; do echo "| $line"; done >&4; } 2>&1 | while IFS= read line; do echo "* $line"; done >&4; } 4>&1 | cat -u >&3; } 5>&1