mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-21 03:54:57 +00: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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue