summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2021-02-18 10:28:37 +0100
committerRémi Verschelde <rverschelde@gmail.com>2021-02-18 10:28:37 +0100
commite26a1f807b93d32be0299614ea79cce40a86130e (patch)
tree93364c88b5f37b91c9221f5f8a080b76994a71ff
parent9d84e3b395631f1ffc27813c0d25bc41f655fb08 (diff)
Linux: Fix fallback logic when udev fails creating a context
Thanks to Noshyaar for pointing out the bug.
-rw-r--r--platform/linuxbsd/joypad_linux.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/platform/linuxbsd/joypad_linux.cpp b/platform/linuxbsd/joypad_linux.cpp
index d1115b146b..9d2a768fb3 100644
--- a/platform/linuxbsd/joypad_linux.cpp
+++ b/platform/linuxbsd/joypad_linux.cpp
@@ -105,11 +105,13 @@ void JoypadLinux::run_joypad_thread() {
udev *_udev = udev_new();
if (!_udev) {
use_udev = false;
- ERR_FAIL_MSG("Failed getting an udev context, falling back to parsing /dev/input.");
+ ERR_PRINT("Failed getting an udev context, falling back to parsing /dev/input.");
+ monitor_joypads();
+ } else {
+ enumerate_joypads(_udev);
+ monitor_joypads(_udev);
+ udev_unref(_udev);
}
- enumerate_joypads(_udev);
- monitor_joypads(_udev);
- udev_unref(_udev);
} else {
monitor_joypads();
}