summaryrefslogtreecommitdiffstats
path: root/tests/util.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/util.sh')
-rw-r--r--tests/util.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/util.sh b/tests/util.sh
index 3969db5..76b72b9 100644
--- a/tests/util.sh
+++ b/tests/util.sh
@@ -59,6 +59,15 @@ stdenv() {
# Close stdin so bfs doesn't think we're interactive
# dup() the standard fds for logging even when redirected
exec </dev/null {DUPOUT}>&1 {DUPERR}>&2
+
+ # Get the ttyname
+ if [ -t $DUPOUT ]; then
+ TTY=$(tty <&$DUPOUT)
+ elif [ -t $DUPERR ]; then
+ TTY=$(tty <&$DUPERR)
+ else
+ TTY=
+ fi
}
# Drop root priviliges or bail