dinput: Check the return of open() properly (Coverity)

Bruno Jesus 00cpxxx at gmail.com
Mon Aug 22 16:07:36 CDT 2016


Signed-off-by: Bruno Jesus <00cpxxx at gmail.com>
-------------- next part --------------
diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c
index 3086e68..0338b91 100644
--- a/dlls/dinput/joystick_linux.c
+++ b/dlls/dinput/joystick_linux.c
@@ -151,7 +151,7 @@ static BOOL read_sys_id_variable(int index, const char *property, WORD *value)
 
     sprintf(sys_path, SYS_PATH_FORMAT, index, property);
     sys_fd = open(sys_path, O_RDONLY);
-    if (sys_fd > 0)
+    if (sys_fd != -1)
     {
         if (read(sys_fd, id_str, 4) == 4)
         {


More information about the wine-patches mailing list