From c9929a4e0eab5eb94aebe7f91a91f37239d1bc6c Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 16 Apr 2019 12:59:09 +0200 Subject: add device_open() --- drmtools.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drmtools.c') diff --git a/drmtools.c b/drmtools.c index 84dbbeb..8fab4b5 100644 --- a/drmtools.c +++ b/drmtools.c @@ -14,6 +14,7 @@ #include "gfx.h" #include "drmtools.h" +#include "logind.h" /* ------------------------------------------------------------------ */ @@ -88,7 +89,7 @@ int drm_init_dev(const char *dev, const char *output, const char *mode) int i, rc; /* open device */ - drm_fd = open(dev, O_RDWR | O_CLOEXEC); + drm_fd = device_open(dev); if (drm_fd < 0) { fprintf(stderr, "drm: open %s: %s\n", dev, strerror(errno)); return -1; @@ -247,7 +248,7 @@ static void drm_suspend_display(void) static void drm_resume_display(void) { - drm_fd = open(drm_dev, O_RDWR | O_CLOEXEC); + drm_fd = device_open(drm_dev); drm_init_fb(&fb1, drm_fmt, false); if (fb2.mem) drm_init_fb(&fb2, drm_fmt, false); @@ -333,7 +334,7 @@ void drm_info(const char *device) } else { snprintf(dev, sizeof(dev), DRM_DEV_NAME, DRM_DIR_NAME, 0); } - drm_fd = open(dev, O_RDWR | O_CLOEXEC); + drm_fd = device_open(dev); if (drm_fd < 0) { fprintf(stderr, "drm: open %s: %s\n", dev, strerror(errno)); return; -- cgit