diff options
author | Derek Foreman <derekf@osg.samsung.com> | 2015-06-17 11:28:50 -0500 |
---|---|---|
committer | Emil Velikov <emil.l.velikov@gmail.com> | 2015-06-23 16:54:53 +0100 |
commit | 324ee9b391ea2db4b74709d30a131e79055bf071 (patch) | |
tree | 7f52cf0f5bd97aa32daff431d94cfe88ae1c6879 /src/glx | |
parent | 9c927463492dea14d82ebdd77f711f86b0e6fc5e (diff) | |
download | external_mesa3d-324ee9b391ea2db4b74709d30a131e79055bf071.zip external_mesa3d-324ee9b391ea2db4b74709d30a131e79055bf071.tar.gz external_mesa3d-324ee9b391ea2db4b74709d30a131e79055bf071.tar.bz2 |
glx: Use loader_open_device() helper
We've moved the open with CLOEXEC idiom into a helper function, so
call it instead of duplicating the code here.
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/glx')
-rw-r--r-- | src/glx/dri2_glx.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 538cf1a..27ea952 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -1183,15 +1183,7 @@ dri2CreateScreen(int screen, struct glx_display * priv) return NULL; } -#ifdef O_CLOEXEC - psc->fd = open(deviceName, O_RDWR | O_CLOEXEC); - if (psc->fd == -1 && errno == EINVAL) -#endif - { - psc->fd = open(deviceName, O_RDWR); - if (psc->fd != -1) - fcntl(psc->fd, F_SETFD, fcntl(psc->fd, F_GETFD) | FD_CLOEXEC); - } + psc->fd = loader_open_device(deviceName); if (psc->fd < 0) { ErrorMessageF("failed to open drm device: %s\n", strerror(errno)); goto handle_error; |