From e26a1f807b93d32be0299614ea79cce40a86130e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 18 Feb 2021 10:28:37 +0100 Subject: [PATCH] Linux: Fix fallback logic when udev fails creating a context Thanks to Noshyaar for pointing out the bug. --- platform/linuxbsd/joypad_linux.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/platform/linuxbsd/joypad_linux.cpp b/platform/linuxbsd/joypad_linux.cpp index d1115b146bc..9d2a768fb31 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(); }