Skip to content

Commit

Permalink
joystick: On Linux, don't try to close an invalid inotify file descri…
Browse files Browse the repository at this point in the history
…ptor.
  • Loading branch information
icculus committed Nov 24, 2020
1 parent 5c95774 commit eaa53a1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/joystick/linux/SDL_sysjoystick.c
Expand Up @@ -1320,8 +1320,10 @@ LINUX_JoystickQuit(void)
SDL_joylist_item *item = NULL;
SDL_joylist_item *next = NULL;

close(inotify_fd);
inotify_fd = -1;
if (inotify_fd >= 0) {
close(inotify_fd);
inotify_fd = -1;
}

for (item = SDL_joylist; item; item = next) {
next = item->next;
Expand Down

0 comments on commit eaa53a1

Please sign in to comment.