aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-10-29 22:06:50 +0100
committerMattias Andrée <maandree@operamail.com>2014-10-29 22:06:50 +0100
commit76bc0cc92f8c22e17383dc5a17175618a7ab3467 (patch)
treea3fb6c201c7a0ad28aec25b1e066d9f3e6f083a5 /src
parentm (diff)
downloadcerberus-logging-76bc0cc92f8c22e17383dc5a17175618a7ab3467.tar.gz
cerberus-logging-76bc0cc92f8c22e17383dc5a17175618a7ab3467.tar.bz2
cerberus-logging-76bc0cc92f8c22e17383dc5a17175618a7ab3467.tar.xz
stdin is closed, use stderr for ttyname
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/logging2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/logging b/src/logging
index 45e4815..8e8e14b 100755
--- a/src/logging
+++ b/src/logging
@@ -21,7 +21,7 @@
# Login username, client hostname if non-local, ttyname, cerberus-hook and PID
username=
hostname=
-ttyname="$(tty | cut -d / -f 1,2 --complement)"
+ttyname="$(tty <&2 | cut -d / -f 1,2 --complement)"
hook="${1}"
pid=$PPID
if [ ! "${LOGIN_PID}" = "" ]; then