[Mesa-dev] [PATCH] Don't manually close fds for queryImage. drm uses CLOEXEC

Chokshi, Mitul mitul.chokshi at intel.com
Thu Apr 14 12:19:09 UTC 2016


If create_wl_buffer() closes the file descriptor returned by
dri2_dpy->image->queryImage then OS hands out the same file
descriptor number to other process which then experiences error
when fd is closed due to CLOEXEC.

Signed-off-by: Mitul Chokshi <mitul.chokshi at intel.com>
---
 src/egl/drivers/dri2/platform_wayland.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index ff0d5c8..b298744 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -635,7 +635,6 @@ create_wl_buffer(struct dri2_egl_surface *dri2_surf)
                                     0, stride,
                                     0, 0,
                                     0, 0);
-      close(fd);
    } else {
       dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_NAME, &name);
       dri2_dpy->image->queryImage(image, __DRI_IMAGE_ATTRIB_STRIDE, &stride);
@@ -844,7 +843,6 @@ dri2_wl_create_wayland_buffer_from_image(_EGLDriver *drv,
                                     0, 0,
                                     0, 0);
 
-      close(fd);
    } else {
       int name;
 
-- 
1.9.1

--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.



More information about the mesa-dev mailing list