launcher: Drop unecessary checks for drm_fd == -1
We never get into this case, and if we do, we just want to pass the invalid fd through to the underlying ioctl and get the error that way."
This commit is contained in:
+5
-10
@@ -69,25 +69,20 @@ struct weston_launcher {
|
|||||||
static int
|
static int
|
||||||
drm_drop_master(int drm_fd)
|
drm_drop_master(int drm_fd)
|
||||||
{
|
{
|
||||||
if (drm_fd != -1)
|
return drmDropMaster(drm_fd);
|
||||||
return drmDropMaster(drm_fd);
|
|
||||||
return -EBADF;
|
|
||||||
}
|
}
|
||||||
static int
|
static int
|
||||||
drm_set_master(int drm_fd)
|
drm_set_master(int drm_fd)
|
||||||
{
|
{
|
||||||
if (drm_fd != -1)
|
return drmSetMaster(drm_fd);
|
||||||
return drmSetMaster(drm_fd);
|
|
||||||
return -EBADF;
|
|
||||||
}
|
}
|
||||||
static int
|
static int
|
||||||
drm_is_master(int drm_fd)
|
drm_is_master(int drm_fd)
|
||||||
{
|
{
|
||||||
drm_magic_t magic;
|
drm_magic_t magic;
|
||||||
if (drm_fd != -1)
|
|
||||||
return drmGetMagic(drm_fd, &magic) == 0 &&
|
return drmGetMagic(drm_fd, &magic) == 0 &&
|
||||||
drmAuthMagic(drm_fd, magic) == 0;
|
drmAuthMagic(drm_fd, magic) == 0;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
static int drm_drop_master(int drm_fd) {return 0;}
|
static int drm_drop_master(int drm_fd) {return 0;}
|
||||||
|
|||||||
Reference in New Issue
Block a user