Mesa (master): auxiliary/vl: use loader_open_device() over open()

Emil Velikov evelikov at kemper.freedesktop.org
Mon Jul 13 19:54:37 UTC 2015


Module: Mesa
Branch: master
Commit: dd50ccf0f4dcba2fd586d5b5c58750259e29c357
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=dd50ccf0f4dcba2fd586d5b5c58750259e29c357

Author: Emil Velikov <emil.l.velikov at gmail.com>
Date:   Mon Jun 29 14:03:22 2015 +0100

auxiliary/vl: use loader_open_device() over open()

The former handles O_CLOEXEC (and the lack of it) appropriately.

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
Reviewed-by: Francisco Jerez <currojerez at riseup.net>

---

 src/gallium/auxiliary/Makefile.am        |    1 +
 src/gallium/auxiliary/vl/vl_winsys_dri.c |    4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/gallium/auxiliary/Makefile.am b/src/gallium/auxiliary/Makefile.am
index ab91062..04f77d0 100644
--- a/src/gallium/auxiliary/Makefile.am
+++ b/src/gallium/auxiliary/Makefile.am
@@ -8,6 +8,7 @@ include $(top_srcdir)/src/gallium/Automake.inc
 noinst_LTLIBRARIES = libgallium.la
 
 AM_CFLAGS = \
+	-I$(top_srcdir)/src/loader \
 	-I$(top_builddir)/src/glsl/nir \
 	-I$(top_srcdir)/src/gallium/auxiliary/util \
 	$(GALLIUM_CFLAGS) \
diff --git a/src/gallium/auxiliary/vl/vl_winsys_dri.c b/src/gallium/auxiliary/vl/vl_winsys_dri.c
index 8e39569..b445f68 100644
--- a/src/gallium/auxiliary/vl/vl_winsys_dri.c
+++ b/src/gallium/auxiliary/vl/vl_winsys_dri.c
@@ -37,6 +37,8 @@
 #include <xf86drm.h>
 #include <errno.h>
 
+#include "loader.h"
+
 #include "pipe/p_screen.h"
 #include "pipe/p_context.h"
 #include "pipe/p_state.h"
@@ -361,7 +363,7 @@ vl_screen_create(Display *display, int screen)
    if (!device_name)
       goto free_connect;
    memcpy(device_name, xcb_dri2_connect_device_name(connect), device_name_length);
-   fd = open(device_name, O_RDWR);
+   fd = loader_open_device(device_name);
    free(device_name);
 
    if (fd < 0)




More information about the mesa-commit mailing list