summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-02-18 11:30:12 +0100
committerGitHub <noreply@github.com>2021-02-18 11:30:12 +0100
commit8870f43d742e0c48ae543d999856f5989170b62d (patch)
tree7164c59facb524cee23b5d3be49b9fbd502cb480
parent65a75dc5f4d8be091c0aed47ca879dcb11fb5c27 (diff)
parente26a1f807b93d32be0299614ea79cce40a86130e (diff)
Merge pull request #46161 from akien-mga/linux-joypads-udev-fallback
Linux: Fix fallback logic when udev fails creating a context
-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();
}