diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2015-06-17 11:28:51 -0500 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2015-06-23 16:54:56 +0100 |
commit | 4f8f790525f1adcb5259cb72b7c9dbfd121867c6 (patch) | |
tree | c244e9662035fdcb1fda5be579aa70e79b33292d /src/egl/drivers/dri2/platform_drm.c | |
parent | 324ee9b391ea2db4b74709d30a131e79055bf071 (diff) | |
download | external_mesa3d-4f8f790525f1adcb5259cb72b7c9dbfd121867c6.zip external_mesa3d-4f8f790525f1adcb5259cb72b7c9dbfd121867c6.tar.gz external_mesa3d-4f8f790525f1adcb5259cb72b7c9dbfd121867c6.tar.bz2 |
egl: Use the loader_open_device() helper to do open with CLOEXEC
We've moved the open with CLOEXEC idiom into a helper function, so
call it instead of duplicating the code.
This also replaces a couple of opens that didn't properly do CLOEXEC.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'src/egl/drivers/dri2/platform_drm.c')
-rw-r--r-- | src/egl/drivers/dri2/platform_drm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c index c97c54f..a62da41 100644 --- a/src/egl/drivers/dri2/platform_drm.c +++ b/src/egl/drivers/dri2/platform_drm.c @@ -611,9 +611,9 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp) char buf[64]; int n = snprintf(buf, sizeof(buf), DRM_DEV_NAME, DRM_DIR_NAME, 0); if (n != -1 && n < sizeof(buf)) - fd = open(buf, O_RDWR); + fd = loader_open_device(buf); if (fd < 0) - fd = open("/dev/dri/card0", O_RDWR); + fd = loader_open_device("/dev/dri/card0"); dri2_dpy->own_device = 1; gbm = gbm_create_device(fd); if (gbm == NULL) |