launcher: Fix reverted sense of drm_check_master() wrapper

Also rename to drm_is_master() to make it clearer what we're checking.

https://bugs.freedesktop.org/show_bug.cgi?id=70459
parent e14aa4f0
......@@ -81,18 +81,18 @@ drm_set_master(int drm_fd)
return -EBADF;
}
static int
drm_check_master(int drm_fd)
drm_is_master(int drm_fd)
{
drm_magic_t magic;
if (drm_fd != -1)
return drmGetMagic(drm_fd, &magic) != 0 ||
drmAuthMagic(drm_fd, magic) != 0;
return drmGetMagic(drm_fd, &magic) == 0 &&
drmAuthMagic(drm_fd, magic) == 0;
return 0;
}
#else
static int drm_drop_master(int drm_fd) {return 0;}
static int drm_set_master(int drm_fd) {return 0;}
static int drm_check_master(int drm_fd) {return 1;}
static int drm_is_master(int drm_fd) {return 1;}
#endif
int
......@@ -121,7 +121,7 @@ weston_launcher_open(struct weston_launcher *launcher,
if (major(s.st_rdev) == DRM_MAJOR) {
launcher->drm_fd = fd;
if (!drm_check_master(fd)) {
if (!drm_is_master(fd)) {
weston_log("drm fd not master\n");
close(fd);
return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment