launcher: Bail out if we can't be drm master

If we can't be drm master, we won't be able to do anything useful with
the drm device.
dev
Kristian Høgsberg 11 years ago
parent 57a10e4d13
commit 1468e60647
  1. 6
      src/launcher-util.c

@ -110,9 +110,11 @@ weston_launcher_open(struct weston_launcher *launcher,
} }
if (major(s.st_rdev) == DRM_MAJOR) { if (major(s.st_rdev) == DRM_MAJOR) {
drm_magic_t magic;
launcher->drm_fd = fd; launcher->drm_fd = fd;
if (drm_set_master(fd) == -1) { if (drmGetMagic(fd, &magic) != 0 ||
weston_log("could not set master on drm fd\n"); drmAuthMagic(fd, magic) != 0) {
weston_log("drm fd not master\n");
close(fd); close(fd);
return -1; return -1;
} }

Loading…
Cancel
Save