[try2] [1/3] winejoystick.drv: fix file descriptor leak

Vincent Pelletier plr.vincent at gmail.com
Mon Jan 19 13:20:59 CST 2009


Woops, thanks for not commiting that stupid mistake.
Attached a revised patch, which *will* try to open the device on the "old" 
input path.

Note on patch dependencies: this patch is not required, strictly speaking, to 
apply other patches from this patchset. It's just that changing this code 
made me spot that bug, and it collides with my changes in the diff.

-- 
Vincent Pelletier
-------------- next part --------------
From 90ff491ba441fd928ffc52c941d0c514dbefcc66 Mon Sep 17 00:00:00 2001
From: Vincent Pelletier <vincent at x2.(none)>
Date: Sat, 17 Jan 2009 12:31:39 +0100
Subject: If JOYDEV_NEW open succeeded, do not open it again.

---
 dlls/winejoystick.drv/joystick.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/winejoystick.drv/joystick.c b/dlls/winejoystick.drv/joystick.c
index 41d6eb8..38fb0cf 100644
--- a/dlls/winejoystick.drv/joystick.c
+++ b/dlls/winejoystick.drv/joystick.c
@@ -178,8 +178,9 @@ static	int	JSTCK_OpenDevice(WINE_JSTCK* jstick)
 #endif
     if ((jstick->dev = open(buf, flags)) < 0) {
         sprintf(buf, JOYDEV_OLD, jstick->joyIntf);
+        jstick->dev = open(buf, flags);
     }
-    return (jstick->dev = open(buf, flags));
+    return jstick->dev;
 }
 
 
-- 
1.5.6.5



More information about the wine-patches mailing list