When stdin is a tty, do not try to dump it.
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
# This script can be provided anywhere an executable or command name is
# wanted. It prints its arguments, and its stdin, to its stderr, and
# then exits nonzero.
-#
-# When using this it may be useful to provide </dev/null as a
-# redirection for the whole program under test. Otherwise things
-# can mysteriously hang.
+
+if tty >/dev/null 2>&1; then
+ exec </dev/null
+fi
bash -xc ': mg-debug-fail "$@"' x "$@"
egrep '' >&2