From af7d4ecf7e939818df2f2a210a376d91dd41291d Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 18 Dec 2011 14:13:30 -0800 Subject: set_colors(): suppress "/dev/tty: No such device" --- bin/isolated-functions.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bin/isolated-functions.sh') diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index 1bcc5c907..9321ad598 100644 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -413,9 +413,11 @@ set_colors() { COLS=${COLUMNS:-0} # bash's internal COLUMNS variable # Avoid wasteful stty calls during the "depend" phases. # If stdout is a pipe, the parent process can export COLUMNS - # if it's relevant. + # if it's relevant. Use an extra subshell for stty calls, in + # order to redirect "/dev/tty: No such device or address" + # error from bash to /dev/null. [[ $COLS == 0 && $EBUILD_PHASE != depend ]] && \ - COLS=$(set -- $(stty size /dev/null) ; echo $2) + COLS=$(set -- $( ( stty size /dev/null || echo 24 80 ) ; echo $2) (( COLS > 0 )) || (( COLS = 80 )) # Now, ${ENDCOL} will move us to the end of the -- cgit v1.2.3-1-g7c22