Procházet zdrojové kódy

Linux joystick fixes.

Camilla Berglund před 13 roky
rodič
revize
8cf093a19d
1 změnil soubory, kde provedl 2 přidání a 2 odebrání
  1. 2 2
      src/x11_joystick.c

+ 2 - 2
src/x11_joystick.c

@@ -53,7 +53,7 @@ static int openJoystickDevice(int joy, const char* path)
     char numAxes, numButtons;
     char numAxes, numButtons;
     int fd, version;
     int fd, version;
 
 
-    fd = open(path, O_NONBLOCK);
+    fd = open(path, O_RDONLY | O_NONBLOCK);
     if (fd == -1)
     if (fd == -1)
         return GL_FALSE;
         return GL_FALSE;
 
 
@@ -127,7 +127,7 @@ static void pollJoystickEvents(void)
             if (errno == ENODEV)
             if (errno == ENODEV)
                 _glfwLibrary.X11.joystick[i].present = GL_FALSE;
                 _glfwLibrary.X11.joystick[i].present = GL_FALSE;
 
 
-            if (result < sizeof(e))
+            if (result == -1)
                 break;
                 break;
 
 
             // We don't care if it's an init event or not
             // We don't care if it's an init event or not