| 264 | } |
| 265 | |
| 266 | bool hasMonitorEvent() |
| 267 | { |
| 268 | // This will not fail since we make sure udevMonitor is valid |
| 269 | const int monitorFd = udev_monitor_get_fd(udevMonitor.get()); |
| 270 | |
| 271 | pollfd fds{monitorFd, POLLIN, 0}; |
| 272 | |
| 273 | return (poll(&fds, 1, 0) > 0) && ((fds.revents & POLLIN) != 0); |
| 274 | } |
| 275 | |
| 276 | // Get a property value from a udev device |
| 277 | const char* getUdevAttribute(udev_device* udevDevice, const std::string& attributeName) |