Set O_CLOEXEC on open() call when opening joysticks on Linux

This commit is contained in:
Victor Chernyakin 2023-12-15 00:53:32 -07:00
parent 2c1d31009f
commit 3475ac20bc

View File

@ -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;