auxiliary/vl: use loader_open_device() over open()
authorEmil Velikov <emil.l.velikov@gmail.com>
Mon, 29 Jun 2015 13:03:22 +0000 (14:03 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 13 Jul 2015 18:57:59 +0000 (19:57 +0100)
The former handles O_CLOEXEC (and the lack of it) appropriately.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/gallium/auxiliary/Makefile.am
src/gallium/auxiliary/vl/vl_winsys_dri.c

index ab91062ef1bd0cfc57eafd0820dda1a94c82d45f..04f77d002c83f53d5245fc03e9e46c4d802303ef 100644 (file)
@@ -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) \
index 8e39569f515485cc776923bf42f5d05e47e860b9..b445f68a1c74e2b1e48d374f7e39be7e12399b08 100644 (file)
@@ -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)