Commit 86e9ab79ce381f5e30f6319f102850f52e042fec

Philipp Wiesemann 2015-06-08T20:46:09

Linux: Fixed not needed call to close() on error. It was called if file descriptor was none and -1.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/haptic/linux/SDL_syshaptic.c b/src/haptic/linux/SDL_syshaptic.c
index 1ababa6..7071cc5 100644
--- a/src/haptic/linux/SDL_syshaptic.c
+++ b/src/haptic/linux/SDL_syshaptic.c
@@ -390,8 +390,8 @@ SDL_SYS_HapticName(int index)
             /* No name found, return device character device */
             name = item->fname;
         }
+        close(fd);
     }
-    close(fd);
 
     return name;
 }