mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-07-03 19:07:11 -04:00
Always close epoll/kqueue file descriptor (#2723)
Resolves #2643, resolves #2721
This commit is contained in:
parent
9bc20f0b42
commit
e8ec45ef97
1 changed files with 2 additions and 0 deletions
|
@ -65,6 +65,7 @@ void NativeMessagingBase::newNativeMessage()
|
|||
EV_SET(ev, fileno(stdin), EVFILT_READ, EV_ADD, 0, 0, nullptr);
|
||||
if (kevent(fd, ev, 1, nullptr, 0, &ts) == -1) {
|
||||
m_notifier->setEnabled(false);
|
||||
::close(fd);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -81,6 +82,7 @@ void NativeMessagingBase::newNativeMessage()
|
|||
event.data.fd = 0;
|
||||
if (epoll_ctl(fd, EPOLL_CTL_ADD, 0, &event) != 0) {
|
||||
m_notifier->setEnabled(false);
|
||||
::close(fd);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue