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>
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) \
#include <xf86drm.h>
#include <errno.h>
+#include "loader.h"
+
#include "pipe/p_screen.h"
#include "pipe/p_context.h"
#include "pipe/p_state.h"
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)