Merge branch '2.6.x' into feature/back-merge

This commit is contained in:
Lukas Dürrenberger 2022-04-07 08:57:06 +02:00
commit cb675b2bbc
2 changed files with 4 additions and 7 deletions

2
.gitignore vendored
View File

@ -37,4 +37,4 @@ build/
# Cache/IDE folders
.cache/
.vscode/
.idea/

View File

@ -29,6 +29,7 @@
#include <SFML/System/Err.hpp>
#include <linux/joystick.h>
#include <libudev.h>
#include <poll.h>
#include <unistd.h>
#include <fcntl.h>
#include <string>
@ -254,13 +255,9 @@ namespace
// This will not fail since we make sure udevMonitor is valid
int monitorFd = udev_monitor_get_fd(udevMonitor);
fd_set descriptorSet;
FD_ZERO(&descriptorSet);
FD_SET(monitorFd, &descriptorSet);
timeval timeout = {0, 0};
pollfd fds{ monitorFd, POLLIN, 0 };
return (select(monitorFd + 1, &descriptorSet, nullptr, nullptr, &timeout) > 0) &&
FD_ISSET(monitorFd, &descriptorSet);
return (poll(&fds, 1, 0) > 0) && ((fds.revents & POLLIN) != 0);
}
// Get a property value from a udev device