diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-02-14 19:54:15 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-02-14 19:54:15 +0100 |
commit | 079a09fbf79050c0794bac0f87d3600ffd5b9db2 (patch) | |
tree | e31317d9ca29e8db45ec1b7b03dabbd7f01fe443 /src/util.c | |
parent | f212ac125fb0f8dda6ed9ac50b0c315dd4f58974 (diff) |
util: properly resolve /dev/console if more than once console= argument was passed on the kernel command line
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c index d0c903993c..80b88b0e4e 100644 --- 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"; |