浏览代码

Linux: Set O_CLOEXEC on evdev fd

Closes #2446
Victor Chernyakin 1 年之前
父节点
当前提交
edd38207a6
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/linux_joystick.c

+ 1 - 1
src/linux_joystick.c

@@ -135,7 +135,7 @@ static GLFWbool openJoystickDevice(const char* path)
     }
     }
 
 
     _GLFWjoystickLinux linjs = {0};
     _GLFWjoystickLinux linjs = {0};
-    linjs.fd = open(path, O_RDONLY | O_NONBLOCK);
+    linjs.fd = open(path, O_RDONLY | O_NONBLOCK | O_CLOEXEC);
     if (linjs.fd == -1)
     if (linjs.fd == -1)
         return GLFW_FALSE;
         return GLFW_FALSE;