chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f212ac1
)
util: properly resolve /dev/console if more than once console= argument was passed...
author
Lennart Poettering
<lennart@poettering.net>
Mon, 14 Feb 2011 18:54:15 +0000
(19:54 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Mon, 14 Feb 2011 18:54:15 +0000
(19:54 +0100)
src/util.c
patch
|
blob
|
history
diff --git
a/src/util.c
b/src/util.c
index d0c903993c6ebb7cde787ff9eeb50b69d4ace443..80b88b0e4e2fee36dc9dbf278ed919276107cc19 100644
(file)
--- a/
src/util.c
+++ b/
src/util.c
@@
-3573,7
+3573,13
@@
const char *default_term_for_tty(const char *tty) {
if (streq(tty, "console"))
if (read_one_line_file("/sys/class/tty/console/active", &active) >= 0) {
truncate_nl(active);
- tty = active;
+
+ /* If multiple log outputs are configured the
+ * last one is what /dev/console points to */
+ if ((tty = strrchr(active, ' ')))
+ tty++;
+ else
+ tty = active;
}
term = tty_is_vc(tty) ? "TERM=linux" : "TERM=vt100";