Skip to content

Commit e23fe90

Browse files
thomasmeyrichardweinberger
authored andcommitted
um: kmsg_dumper: always dump when not tty console
With the addition of the ttynull console driver, the chance that a console driver was already registerd did increase. Refine the logic when to dump the kernel message buffer: always dump the buffer, when the UML stdio console driver is not active and the preferred console. Signed-off-by: Thomas Meyer <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent d7ffac3 commit e23fe90

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

arch/um/kernel/kmsg_dump.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0
22
#include <linux/kmsg_dump.h>
33
#include <linux/console.h>
4+
#include <linux/string.h>
45
#include <shared/init.h>
56
#include <shared/kern.h>
67
#include <os.h>
@@ -16,8 +17,12 @@ static void kmsg_dumper_stdout(struct kmsg_dumper *dumper,
1617
if (!console_trylock())
1718
return;
1819

19-
for_each_console(con)
20-
break;
20+
for_each_console(con) {
21+
if(strcmp(con->name, "tty") == 0 &&
22+
(con->flags & (CON_ENABLED | CON_CONSDEV)) != 0) {
23+
break;
24+
}
25+
}
2126

2227
console_unlock();
2328

0 commit comments

Comments
 (0)