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
This commit is contained in:
parent
e14aa4f0a9
commit
876c75f1fa
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user