소스 검색

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

It was called if file descriptor was none and -1.
Philipp Wiesemann 10 년 전
부모
커밋
86e9ab79ce
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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;
 }