Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Corrected device instance value for Linux joysticks.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Dec 14, 2012
1 parent b2bb1ec commit 637ae9e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
3 changes: 1 addition & 2 deletions src/joystick/linux/SDL_sysjoystick.c
Expand Up @@ -722,7 +722,7 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index)
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) {
Expand All @@ -732,7 +732,6 @@ SDL_SYS_JoystickOpen(SDL_Joystick * joystick, int device_index)
}
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);
Expand Down
1 change: 0 additions & 1 deletion src/joystick/linux/SDL_sysjoystick_c.h
Expand Up @@ -25,7 +25,6 @@
struct joystick_hwdata
{
int fd;
int device_instance;
SDL_bool removed;

SDL_JoystickGUID guid;
Expand Down

0 comments on commit 637ae9e

Please sign in to comment.