[PATCH] libweston: Only check for a VT on seat0, as only seat0 has VTs

nerdopolis bluescreen_avenger at verizon.net
Sun Aug 27 02:29:51 UTC 2017


---
 libweston/launcher-logind.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/libweston/launcher-logind.c b/libweston/launcher-logind.c
index a069bd4f..7cc6f963 100644
--- a/libweston/launcher-logind.c
+++ b/libweston/launcher-logind.c
@@ -762,18 +762,20 @@ launcher_logind_connect(struct weston_launcher **out, struct weston_compositor *
 		free(t);
 		goto err_session;
 	}
-	free(t);
 
-	r = weston_sd_session_get_vt(wl->sid, &wl->vtnr);
-	if (r < 0) {
-		weston_log("logind: session not running on a VT\n");
-		goto err_session;
-	} else if (tty > 0 && wl->vtnr != (unsigned int )tty) {
-		weston_log("logind: requested VT --tty=%d differs from real session VT %u\n",
-			   tty, wl->vtnr);
-		r = -EINVAL;
-		goto err_session;
+        if (!strcmp(t, "seat0") {
+		r = weston_sd_session_get_vt(wl->sid, &wl->vtnr);
+		if (r < 0) {
+			weston_log("logind: session not running on a VT\n");
+			goto err_session;
+		} else if (tty > 0 && wl->vtnr != (unsigned int )tty) {
+			weston_log("logind: requested VT --tty=%d differs from real session VT %u\n",
+				   tty, wl->vtnr);
+			r = -EINVAL;
+			goto err_session;
+		}
 	}
+	free(t);
 
 	loop = wl_display_get_event_loop(compositor->wl_display);
 	r = weston_dbus_open(loop, DBUS_BUS_SYSTEM, &wl->dbus, &wl->dbus_ctx);
-- 
2.14.1



More information about the wayland-devel mailing list