From 3475ac20bcb7360c5e42449b2369d073f1373f21 Mon Sep 17 00:00:00 2001 From: Victor Chernyakin <56512186+LocalSpook@users.noreply.github.com> Date: Fri, 15 Dec 2023 00:53:32 -0700 Subject: [PATCH] Set `O_CLOEXEC` on `open()` call when opening joysticks on Linux --- src/linux_joystick.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;