diff options
Diffstat (limited to 'platform/linuxbsd/joypad_linux.cpp')
-rw-r--r-- | platform/linuxbsd/joypad_linux.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/platform/linuxbsd/joypad_linux.cpp b/platform/linuxbsd/joypad_linux.cpp index 8ea0f6c246..e8f4352dff 100644 --- a/platform/linuxbsd/joypad_linux.cpp +++ b/platform/linuxbsd/joypad_linux.cpp @@ -178,17 +178,18 @@ void JoypadLinux::monitor_joypads(udev *p_udev) { select() ensured that this will not block. */ dev = udev_monitor_receive_device(mon); - if (dev && udev_device_get_devnode(dev) != 0) { + if (dev && udev_device_get_devnode(dev) != nullptr) { MutexLock lock(joy_mutex); String action = udev_device_get_action(dev); const char *devnode = udev_device_get_devnode(dev); if (devnode) { String devnode_str = devnode; if (devnode_str.find(ignore_str) == -1) { - if (action == "add") + if (action == "add") { open_joypad(devnode); - else if (String(action) == "remove") + } else if (String(action) == "remove") { close_joypad(get_joy_from_path(devnode)); + } } } @@ -212,7 +213,7 @@ void JoypadLinux::monitor_joypads() { struct dirent *current; char fname[64]; - while ((current = readdir(input_directory)) != NULL) { + while ((current = readdir(input_directory)) != nullptr) { if (strncmp(current->d_name, "event", 5) != 0) { continue; } |