egl_dri2.c: Open drm device with O_CLOEXEC
authorKristian Høgsberg <krh@bitplanet.net>
Thu, 7 Apr 2011 22:27:06 +0000 (18:27 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Thu, 7 Apr 2011 22:27:56 +0000 (18:27 -0400)
Not a good fd to leak.

src/egl/drivers/dri2/platform_x11.c

index e7fe95da8e864cbcc7751505a422144f8c005883..5d4ac6ae9482b862aa01f5efed6eb4afa5f24fc1 100644 (file)
@@ -990,7 +990,7 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
    if (!dri2_load_driver(disp))
       goto cleanup_conn;
 
-   dri2_dpy->fd = open(dri2_dpy->device_name, O_RDWR);
+   dri2_dpy->fd = open(dri2_dpy->device_name, O_RDWR | O_CLOEXEC);
    if (dri2_dpy->fd == -1) {
       _eglLog(_EGL_WARNING,
              "DRI2: could not open %s (%s)", dri2_dpy->device_name,