1From 8ffe3afb0f41f07c69efa17bfce969d0d2255c9d Mon Sep 17 00:00:00 2001
2From: Jeffy Chen <jeffy.chen@rock-chips.com>
3Date: Thu, 7 Jan 2021 03:38:36 +0800
4Subject: [PATCH 03/79] launcher-direct: Only require tty when vt switching
5 enabled
6
7Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
8---
9 libweston/launcher-direct.c | 2 +-
10 1 file changed, 1 insertion(+), 1 deletion(-)
11
12diff --git a/libweston/launcher-direct.c b/libweston/launcher-direct.c
13index c04ba85..87fe826 100644
14--- a/libweston/launcher-direct.c
15+++ b/libweston/launcher-direct.c
16@@ -318,7 +318,7 @@ launcher_direct_connect(struct weston_launcher **out, struct weston_compositor *
17 	/* Checking the existance of /dev/tty0 and verifying it's a TTY
18 	 * device, as kernels compiled with CONFIG_VT=0 do not create these
19 	 * devices. */
20-	if (stat("/dev/tty0", &buf) == 0 &&
21+	if (compositor->vt_switching && stat("/dev/tty0", &buf) == 0 &&
22 	    strcmp("seat0", seat_id) == 0 && major(buf.st_rdev) == TTY_MAJOR) {
23 		if (setup_tty(launcher, tty) == -1) {
24 			free(launcher);
25--
262.20.1
27
28