Vitaliy Margolen : dinput: Don't close fd before we done with it.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Feb 5 07:45:08 CST 2007


Module: wine
Branch: master
Commit: 15e0ccab9bc549841c6440b8ebf130f5324758ca
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=15e0ccab9bc549841c6440b8ebf130f5324758ca

Author: Vitaliy Margolen <wine-patches at kievinfo.com>
Date:   Fri Feb  2 00:46:17 2007 -0700

dinput: Don't close fd before we done with it.

---

 dlls/dinput/joystick_linuxinput.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c
index 3815c22..9c05500 100644
--- a/dlls/dinput/joystick_linuxinput.c
+++ b/dlls/dinput/joystick_linuxinput.c
@@ -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
 




More information about the wine-cvs mailing list