diff options
Diffstat (limited to 'xserver/hw/xfree86/os-support/linux/lnx_platform.c')
-rw-r--r-- | xserver/hw/xfree86/os-support/linux/lnx_platform.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/xserver/hw/xfree86/os-support/linux/lnx_platform.c b/xserver/hw/xfree86/os-support/linux/lnx_platform.c index 1d145b362..70374ace8 100644 --- a/xserver/hw/xfree86/os-support/linux/lnx_platform.c +++ b/xserver/hw/xfree86/os-support/linux/lnx_platform.c @@ -26,19 +26,16 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) drmSetVersion sv; drmVersionPtr v; char *buf; - int major, minor, fd; + int fd; int err = 0; Bool paused, server_fd = FALSE; - major = attribs->major; - minor = attribs->minor; - - fd = systemd_logind_take_fd(major, minor, path, &paused); + fd = systemd_logind_take_fd(attribs->major, attribs->minor, path, &paused); if (fd != -1) { if (paused) { LogMessage(X_ERROR, "Error systemd-logind returned paused fd for drm node\n"); - systemd_logind_release_fd(major, minor, -1); + systemd_logind_release_fd(attribs->major, attribs->minor, -1); return FALSE; } attribs->fd = fd; @@ -46,7 +43,7 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) } if (fd == -1) - fd = open(path, O_RDWR, O_CLOEXEC); + fd = open(path, O_RDWR | O_CLOEXEC, 0); if (fd == -1) return FALSE; |