Corrected device instance value for Linux joysticks.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 13 Dec 2012 22:18:32 -0500
changeset 6751 a1f87fd7ed72
parent 6750 f8633a3d1cda
child 6752 8de11011eb1f
Corrected device instance value for Linux joysticks.
src/joystick/linux/SDL_sysjoystick.c
src/joystick/linux/SDL_sysjoystick_c.h
--- a/src/joystick/linux/SDL_sysjoystick.c	Thu Dec 13 16:57:12 2012 -0800
+++ b/src/joystick/linux/SDL_sysjoystick.c	Thu Dec 13 22:18:32 2012 -0500
@@ -722,7 +722,7 @@
         return -1;
     }
 
-    joystick->instance_id = device_index;
+    joystick->instance_id = item->device_instance;
     joystick->hwdata = (struct joystick_hwdata *)
         SDL_malloc(sizeof(*joystick->hwdata));
     if (joystick->hwdata == NULL) {
@@ -732,7 +732,6 @@
     }
     SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
     joystick->hwdata->removed = SDL_FALSE;
-    joystick->hwdata->device_instance = item->device_instance;
     joystick->hwdata->guid = item->guid;
     joystick->hwdata->fd = fd;
     joystick->hwdata->fname = SDL_strdup(item->path);
--- a/src/joystick/linux/SDL_sysjoystick_c.h	Thu Dec 13 16:57:12 2012 -0800
+++ b/src/joystick/linux/SDL_sysjoystick_c.h	Thu Dec 13 22:18:32 2012 -0500
@@ -25,7 +25,6 @@
 struct joystick_hwdata
 {
     int fd;
-    int device_instance;
     SDL_bool removed;
 
     SDL_JoystickGUID guid;