From 079a09fbf79050c0794bac0f87d3600ffd5b9db2 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 14 Feb 2011 19:54:15 +0100 Subject: [PATCH] util: properly resolve /dev/console if more than once console= argument was passed on the kernel command line --- src/util.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/util.c b/src/util.c index d0c90399..80b88b0e 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"; -- 2.39.5