From dc4f0f6c912b7cec8340fbc17d39cb70e7600045 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Fri, 23 Jan 2015 16:53:41 -0500 Subject: [PATCH] Fixed close being used instead of inotify_rm_watch. Closes #432. Fixes #440. --- README.md | 2 ++ src/linux_joystick.c | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8b11f9c9..20a909e7 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,7 @@ GLFW bundles a number of dependencies in the `deps/` directory. - [X11] Added support for Cygwin-X - [X11] Made XInput2 optional at compile-time - [X11] Made Xxf86vm optional at compile-time + - [X11] Bugfix: `glfwTerminate` could close an unrelated file descriptor ## Contact @@ -142,6 +143,7 @@ skills. - David Medlock - Jonathan Mercier - Marcel Metz + - Jonathan Miller - Kenneth Miller - Bruce Mitchener - Jack Moffitt diff --git a/src/linux_joystick.c b/src/linux_joystick.c index 5f46519b..5a9d8e2a 100644 --- a/src/linux_joystick.c +++ b/src/linux_joystick.c @@ -277,11 +277,13 @@ void _glfwTerminateJoysticks(void) regfree(&_glfw.linux_js.regex); - if (_glfw.linux_js.watch > 0) - close(_glfw.linux_js.watch); - if (_glfw.linux_js.inotify > 0) + { + if (_glfw.linux_js.watch > 0) + inotify_rm_watch(_glfw.linux_js.inotify, _glfw.linux_js.watch); + close(_glfw.linux_js.inotify); + } #endif // __linux__ }