From 8cf093a19dbae45b12d832aa542790773b34b04f Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Fri, 7 Sep 2012 01:01:17 +0200 Subject: [PATCH] Linux joystick fixes. --- src/x11_joystick.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/x11_joystick.c b/src/x11_joystick.c index a5700c68..1895dc6a 100644 --- a/src/x11_joystick.c +++ b/src/x11_joystick.c @@ -53,7 +53,7 @@ static int openJoystickDevice(int joy, const char* path) char numAxes, numButtons; int fd, version; - fd = open(path, O_NONBLOCK); + fd = open(path, O_RDONLY | O_NONBLOCK); if (fd == -1) return GL_FALSE; @@ -127,7 +127,7 @@ static void pollJoystickEvents(void) if (errno == ENODEV) _glfwLibrary.X11.joystick[i].present = GL_FALSE; - if (result < sizeof(e)) + if (result == -1) break; // We don't care if it's an init event or not