diff options
author | P. J. McDermott <pj@pehjota.net> | 2014-06-03 16:25:17 (EDT) |
---|---|---|
committer | P. J. McDermott <pj@pehjota.net> | 2014-06-03 16:25:17 (EDT) |
commit | eba2e893c235a83b44e0e23983ca241b8b29bd2d (patch) | |
tree | 8ca48f045fc62b250bc6adefda4d9b6720bb408c | |
parent | 82a0226c1d8c408d013fba4c28b07a5517873791 (diff) |
/etc/rc.common: Fix tty_printf().
Apparently local always returns a 0 exit status, so tty_printf() would
print something (to a file named "not a tty") even if stdin was not a
tty.
-rw-r--r-- | src.etc/rc.common | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src.etc/rc.common b/src.etc/rc.common index 7bf1917..7ddc27e 100644 --- a/src.etc/rc.common +++ b/src.etc/rc.common @@ -52,7 +52,9 @@ main() tty_printf() { - local tty="$(tty)" && printf "${@}" >"${tty}" + local tty= + + tty="$(tty)" && printf "${@}" >"${tty}" } usage() { |