Merge pull request #46161 from akien-mga/linux-joypads-udev-fallback

Linux: Fix fallback logic when udev fails creating a context
This commit is contained in:
Rémi Verschelde 2021-02-18 11:30:12 +01:00 committed by GitHub
commit 8870f43d74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -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();
}