summaryrefslogtreecommitdiff
path: root/src/launcher-util.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2013-10-14 13:59:53 -0700
committerKristian Høgsberg <krh@bitplanet.net>2013-10-14 14:00:03 -0700
commit891a16ddee7dda37ff8ac353c613ff4cd745c5cf (patch)
treed38360092d0220fc0c172649137e3fd5f76270cd /src/launcher-util.c
parent876c75f1fabe77b2b190d4c62305428b8099b689 (diff)
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."
Diffstat (limited to 'src/launcher-util.c')
-rw-r--r--src/launcher-util.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/launcher-util.c b/src/launcher-util.c
index ea208951..4f77d115 100644
--- a/src/launcher-util.c
+++ b/src/launcher-util.c
@@ -69,25 +69,20 @@ struct weston_launcher {
static int
drm_drop_master(int drm_fd)
{
- if (drm_fd != -1)
- return drmDropMaster(drm_fd);
- return -EBADF;
+ return drmDropMaster(drm_fd);
}
static int
drm_set_master(int drm_fd)
{
- if (drm_fd != -1)
- return drmSetMaster(drm_fd);
- return -EBADF;
+ return drmSetMaster(drm_fd);
}
static int
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 0;
+
+ return drmGetMagic(drm_fd, &magic) == 0 &&
+ drmAuthMagic(drm_fd, magic) == 0;
}
#else
static int drm_drop_master(int drm_fd) {return 0;}