aboutsummaryrefslogtreecommitdiffstats
path: root/rc.d
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2010-08-18 15:28:56 +0200
committerBill Nottingham <notting@redhat.com>2010-08-19 17:06:04 -0400
commitf27b9adb57c38b296add2f5ee8bfed47cfdd013a (patch)
tree23524069844073b218eb74587d6831ed83fe98f6 /rc.d
parent9a4b00572b74450950e53d3c112070b7a20f156b (diff)
downloadinitscripts-f27b9adb57c38b296add2f5ee8bfed47cfdd013a.tar
initscripts-f27b9adb57c38b296add2f5ee8bfed47cfdd013a.tar.gz
initscripts-f27b9adb57c38b296add2f5ee8bfed47cfdd013a.tar.bz2
initscripts-f27b9adb57c38b296add2f5ee8bfed47cfdd013a.tar.xz
initscripts-f27b9adb57c38b296add2f5ee8bfed47cfdd013a.zip
functions: check type of stdout/stderr instead of stdin
Diffstat (limited to 'rc.d')
-rw-r--r--rc.d/init.d/functions4
1 files changed, 3 insertions, 1 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index 15fc6415..3ce93ecf 100644
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -16,7 +16,9 @@ export PATH
# Get a sane screen width
[ -z "${COLUMNS:-}" ] && COLUMNS=80
-[ -z "${CONSOLETYPE:-}" ] && CONSOLETYPE="$(/sbin/consoletype)"
+# /sbin/consoletype checks the type of stdin. Since we are mostly
+# interested in output, we use redirection to check stdout/stderr instead.
+[ -z "${CONSOLETYPE:-}" ] && CONSOLETYPE="$(/sbin/consoletype < /dev/stderr)"
if [ -z "${NOLOCALE:-}" ] && [ -z "${LANGSH_SOURCED:-}" ] && [ -f /etc/sysconfig/i18n ] ; then
. /etc/profile.d/lang.sh 2>/dev/null