diff --git a/src/linux_joystick.c b/src/linux_joystick.c index 78d867eb..a25067e1 100644 --- a/src/linux_joystick.c +++ b/src/linux_joystick.c @@ -137,7 +137,7 @@ static GLFWbool openJoystickDevice(const char* path) } _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) return GLFW_FALSE;