Mercurial > sdl-ios-xcode
comparison src/joystick/linux/SDL_sysjoystick.c @ 3590:493f252a455c
Fixed crash in joystick handling code. Newer 2.6 kernels add an additional 'resolution' field to input_absinfo. Note that we don't use that structure since we want to have enough space for the values even when building with an older kernel.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 17 Dec 2009 07:22:48 +0000 |
parents | c9dcc73f6a36 |
children | f7b03b6838cb |
comparison
equal
deleted
inserted
replaced
3589:06f0768a904c | 3590:493f252a455c |
---|---|
699 if (i == ABS_HAT0X) { | 699 if (i == ABS_HAT0X) { |
700 i = ABS_HAT3Y; | 700 i = ABS_HAT3Y; |
701 continue; | 701 continue; |
702 } | 702 } |
703 if (test_bit(i, absbit)) { | 703 if (test_bit(i, absbit)) { |
704 int values[5]; | 704 int values[6]; |
705 | 705 |
706 if (ioctl(fd, EVIOCGABS(i), values) < 0) | 706 if (ioctl(fd, EVIOCGABS(i), values) < 0) |
707 continue; | 707 continue; |
708 #ifdef DEBUG_INPUT_EVENTS | 708 #ifdef DEBUG_INPUT_EVENTS |
709 printf("Joystick has absolute axis: %x\n", i); | 709 printf("Joystick has absolute axis: %x\n", i); |