diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2016-02-01 13:45:46 +0100 |
---|---|---|
committer | Rémi Verschelde <remi@verschelde.fr> | 2016-02-01 13:45:46 +0100 |
commit | 519c8667032225d2c987562a716c7a2629198772 (patch) | |
tree | 2f686a61a796012f28608bf37208857f507d22cb | |
parent | d3bd1a731c0c1d06abe15e5eea5de64453008b28 (diff) | |
parent | 2809b31f8c7b87a020d2c8f4750d3652176b936d (diff) |
Merge pull request #3536 from Hinsbart/close
close file descriptor if ioctls failed
-rw-r--r-- | platform/x11/joystick_linux.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/platform/x11/joystick_linux.cpp b/platform/x11/joystick_linux.cpp index 5007976f0d..208bb2a2b7 100644 --- a/platform/x11/joystick_linux.cpp +++ b/platform/x11/joystick_linux.cpp @@ -304,6 +304,7 @@ void joystick_linux::open_joystick(const char *p_path) { if ((ioctl(fd, EVIOCGBIT(0, sizeof(evbit)), evbit) < 0) || (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) < 0) || (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit) < 0)) { + close(fd); return; } |