1 From 8aec01a4d5d098430cdb369a69a85cdbf20ebc99 Mon Sep 17 00:00:00 2001
2 From: Julien Cristau <jcristau@debian.org>
3 Date: Thu, 25 Aug 2011 23:08:05 +0200
4 Subject: [PATCH] Work around the lack of O_CLOEXEC on kbsd
6 Not that dri2 is going to work there, but well.
8 src/egl/drivers/dri2/platform_x11.c | 6 ++++++
9 1 files changed, 6 insertions(+), 0 deletions(-)
11 diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
12 index 4e00c95..f38d6c0 100644
13 --- a/src/egl/drivers/dri2/platform_x11.c
14 +++ b/src/egl/drivers/dri2/platform_x11.c
15 @@ -997,7 +997,13 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
16 if (!dri2_load_driver(disp))
20 dri2_dpy->fd = open(dri2_dpy->device_name, O_RDWR | O_CLOEXEC);
22 + dri2_dpy->fd = open(dri2_dpy->device_name, O_RDWR);
23 + if (dri2_dpy->fd >= 0)
24 + fcntl(dri2_dpy->fd, F_SETFD, fcntl(dri2_dpy->fd, F_GETFD) | FD_CLOEXEC);
26 if (dri2_dpy->fd == -1) {
28 "DRI2: could not open %s (%s)", dri2_dpy->device_name,