Explorar el Código

Linux: Fixed not needed call to close() on error.

It was called if file descriptor was none and -1.
Philipp Wiesemann hace 10 años
padre
commit
86e9ab79ce
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/haptic/linux/SDL_syshaptic.c

+ 1 - 1
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;
 }