Skip to content
Snippets Groups Projects
Commit 72db3ac6 authored by nerdopolis's avatar nerdopolis Committed by Pekka Paalanen
Browse files

launcher-direct: handle seat0 without VTs

This allows launcher-direct to run when seat0 has no TTYs
This checks for a proper /dev/tty0 device as /dev/tty0
does not get created by kernels compiled with CONFIG_VT=n
parent fbc065fd
No related branches found
No related tags found
1 merge request!490Accommodate for CONFIG_VT=0, all TTYs are in seat0, but not all seat0s have TTYs
......@@ -304,6 +304,7 @@ launcher_direct_connect(struct weston_launcher **out, struct weston_compositor *
int tty, const char *seat_id, bool sync_drm)
{
struct launcher_direct *launcher;
struct stat buf;
launcher = zalloc(sizeof(*launcher));
if (launcher == NULL) {
......@@ -314,7 +315,11 @@ launcher_direct_connect(struct weston_launcher **out, struct weston_compositor *
launcher->base.iface = &launcher_direct_iface;
launcher->compositor = compositor;
if (strcmp("seat0", seat_id) == 0) {
/* Checking the existance of /dev/tty0 and verifying it's a TTY
* device, as kernels compiled with CONFIG_VT=0 do not create these
* devices. */
if (stat("/dev/tty0", &buf) == 0 &&
strcmp("seat0", seat_id) == 0 && major(buf.st_rdev) == TTY_MAJOR) {
if (setup_tty(launcher, tty) == -1) {
free(launcher);
return -1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment