[PATCH xserver 1/2] xfree86: Fix O_CLOEXEC usage in lnx_platform

Michel Dänzer michel at daenzer.net
Fri May 18 09:23:00 UTC 2018


From: Michel Dänzer <michel.daenzer at amd.com>

It was passing O_CLOEXEC as permission bits instead of as a flag.

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 hw/xfree86/os-support/linux/lnx_platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/xfree86/os-support/linux/lnx_platform.c b/hw/xfree86/os-support/linux/lnx_platform.c
index 11af52c46..70374ace8 100644
--- a/hw/xfree86/os-support/linux/lnx_platform.c
+++ b/hw/xfree86/os-support/linux/lnx_platform.c
@@ -43,7 +43,7 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index)
     }
 
     if (fd == -1)
-        fd = open(path, O_RDWR, O_CLOEXEC);
+        fd = open(path, O_RDWR | O_CLOEXEC, 0);
 
     if (fd == -1)
         return FALSE;
-- 
2.17.0



More information about the xorg-devel mailing list