mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-11-21 01:21:37 -08:00
Always close epoll/kqueue file descriptor (#2723)
Resolves #2643, resolves #2721
This commit is contained in:
1 parent
9bc20f0b42
commit
e8ec45ef97
1 file changed
+2
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user