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.
This commit is contained in:
Kristian Høgsberg
2013-10-02 10:49:05 -07:00
parent 57a10e4d13
commit 1468e60647
+4 -2
View File
@@ -110,9 +110,11 @@ weston_launcher_open(struct weston_launcher *launcher,
}
if (major(s.st_rdev) == DRM_MAJOR) {
drm_magic_t magic;
launcher->drm_fd = fd;
if (drm_set_master(fd) == -1) {
weston_log("could not set master on drm fd\n");
if (drmGetMagic(fd, &magic) != 0 ||
drmAuthMagic(fd, magic) != 0) {
weston_log("drm fd not master\n");
close(fd);
return -1;
}