mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-09 22:18:58 +01:00
evdev: Fix select() call
It's not guaranteed that the eventfd is smaller than the monitor fd, because fds are not always monotonically allocated. To select() correctly in all cases, use the max between the monitor fd and eventfd.
This commit is contained in:
parent
51d3de6787
commit
9a3705f82d
@ -72,7 +72,7 @@ static void HotplugThreadFunc()
|
||||
FD_SET(monitor_fd, &fds);
|
||||
FD_SET(s_wakeup_eventfd, &fds);
|
||||
|
||||
int ret = select(monitor_fd + 1, &fds, nullptr, nullptr, nullptr);
|
||||
int ret = select(std::max(monitor_fd, s_wakeup_eventfd) + 1, &fds, nullptr, nullptr, nullptr);
|
||||
if (ret < 1 || !FD_ISSET(monitor_fd, &fds))
|
||||
continue;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user