egl/drm: Duplicate fd with F_DUPFD_CLOEXEC to prevent leak
authorDerek Foreman <derekf@osg.samsung.com>
Wed, 17 Jun 2015 16:28:48 +0000 (11:28 -0500)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 23 Jun 2015 15:54:47 +0000 (16:54 +0100)
commitaaac913e901229d11a1894f6aaf646de6b1a542c
tree1458cda8de9093cb8b8ff6a45aeba60624497eb3
parentbe5f71d4a52c9ef72f63bb6c339fe0110f2027af
egl/drm: Duplicate fd with F_DUPFD_CLOEXEC to prevent leak

Replacing dup() with fcntl F_DUPFD_CLOEXEC creates the duplicate
file descriptor with CLOEXEC so it won't be leaked to child
processes if the process fork()s later.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
src/egl/drivers/dri2/platform_drm.c