diff options
author | Robert Nagy <robert@cvs.openbsd.org> | 2021-01-09 07:22:50 +0000 |
---|---|---|
committer | Robert Nagy <robert@cvs.openbsd.org> | 2021-01-09 07:22:50 +0000 |
commit | cae058d3c3d681416b09b9ed79daa0ac034cbd5a (patch) | |
tree | 74bd07e03d85ccb201d74d71e61328622929a5fb /driver | |
parent | b023969bcd2d381910b09079b1fd83a7fa1e8c74 (diff) |
unbreak DRI3 support by using priv_open_device() to open the devices
priv_open_device() has to be used in case the X server is running
privilege separated
ok jsg@
Diffstat (limited to 'driver')
-rw-r--r-- | driver/xf86-video-intel/src/intel_device.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/driver/xf86-video-intel/src/intel_device.c b/driver/xf86-video-intel/src/intel_device.c index 2e16ce5fa..5d4398d7b 100644 --- a/driver/xf86-video-intel/src/intel_device.c +++ b/driver/xf86-video-intel/src/intel_device.c @@ -64,6 +64,12 @@ #include "intel_driver.h" #include "fd.h" +#ifdef X_PRIVSEP +extern int priv_open_device(const char *); +#else +#define priv_open_device(n) open(n,O_RDWR|O_CLOEXEC) +#endif + struct intel_device { char *master_node; char *render_node; @@ -696,9 +702,7 @@ int intel_get_client_fd(ScrnInfoPtr scrn) assert(dev->fd != -1); assert(dev->render_node); -#ifdef O_CLOEXEC - fd = open(dev->render_node, O_RDWR | O_CLOEXEC); -#endif + fd = priv_open_device(dev->render_node); if (fd < 0) fd = fd_set_cloexec(open(dev->render_node, O_RDWR)); if (fd < 0) |