mirror of
git://source.winehq.org/git/wine.git
synced 2024-11-01 09:50:52 +00:00
dinput: Don't close fd before we done with it.
This commit is contained in:
parent
67b6044de7
commit
15e0ccab9b
1 changed files with 6 additions and 8 deletions
|
@ -242,16 +242,14 @@ static void find_joydevs(void)
|
|||
);
|
||||
|
||||
#ifdef HAVE_STRUCT_FF_EFFECT_DIRECTION
|
||||
if (!no_ff_check) {
|
||||
if ((!test_bit(joydev.evbits,EV_FF))
|
||||
|| (-1==ioctl(fd,EVIOCGBIT(EV_FF,sizeof(joydev.ffbits)),joydev.ffbits))
|
||||
|| (-1==ioctl(fd,EVIOCGEFFECTS,&joydev.num_effects))
|
||||
|| (joydev.num_effects <= 0)) {
|
||||
close(fd);
|
||||
} else {
|
||||
if (!no_ff_check &&
|
||||
test_bit(joydev.evbits, EV_FF) &&
|
||||
ioctl(fd, EVIOCGBIT(EV_FF, sizeof(joydev.ffbits)), joydev.ffbits) != -1 &&
|
||||
ioctl(fd, EVIOCGEFFECTS, &joydev.num_effects) != -1 &&
|
||||
joydev.num_effects > 0)
|
||||
{
|
||||
TRACE(" ... with force feedback\n");
|
||||
joydev.has_ff = 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue