mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-25 11:50:06 +01:00
modesetting: Pass O_CLOEXEC when opening a DRM device
We don't want DRM file descriptors to leak to child processes. Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
parent
ab53e2859f
commit
315c63c41d
1 changed files with 3 additions and 3 deletions
|
|
@ -200,12 +200,12 @@ open_hw(const char *dev)
|
|||
int fd;
|
||||
|
||||
if (dev)
|
||||
fd = open(dev, O_RDWR, 0);
|
||||
fd = open(dev, O_RDWR | O_CLOEXEC, 0);
|
||||
else {
|
||||
dev = getenv("KMSDEVICE");
|
||||
if ((NULL == dev) || ((fd = open(dev, O_RDWR, 0)) == -1)) {
|
||||
if ((NULL == dev) || ((fd = open(dev, O_RDWR | O_CLOEXEC, 0)) == -1)) {
|
||||
dev = "/dev/dri/card0";
|
||||
fd = open(dev, O_RDWR, 0);
|
||||
fd = open(dev, O_RDWR | O_CLOEXEC, 0);
|
||||
}
|
||||
}
|
||||
if (fd == -1)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue