Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Author Topic: EVIOCGBIT Issue  (Read 821 times)

aerique

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 1
    • View Profile
EVIOCGBIT Issue
« on: September 28, 2009, 01:11:20 AM »

Hi,

I've been getting messages like this in my syslog (Linux 2.6.30):

Quote
Sep 24 17:55:59 azrael kernel: [216963.680034] evdev.c(EVIOCGBIT): Suspicious buffer size 511, limiting output to 64 bytes. See http://userweb.kernel.org/~dtor/eviocgbit-bug.html

So I changed this in Eventhelpers.cpp:

Code: [Select]
# diff EventHelpers.cpp EventHelpers.cpp-DIST
67,68c67,68
< ioctl(deviceID, EVIOCGBIT(i, sizeof(info[1])), info[1]);
< for (int j = 0; j < sizeof(info[1]); j++)
---
> ioctl(deviceID, EVIOCGBIT(i, KEY_MAX), info[1]);
> for (int j = 0; j < KEY_MAX; j++)

It seems to work (ie. the syslog messages are gone and my app doesn't crash) but I've no idea whether it's actually a good fix.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2653
    • View Profile
    • http://www.wreckedgames.com
Re: EVIOCGBIT Issue
« Reply #1 on: October 03, 2009, 08:11:25 AM »

I couldn't say either way, haven't looked at that code in a while (and was changed by a patch). Would be nice if you could put the patch on sourceforge, so it doesn't get forgotten/lost.
Logged