mirror of
https://github.com/darlinghq/darling-libkqueue.git
synced 2024-11-26 21:20:38 +00:00
Don't check for new events if KEVENT_FLAG_ERROR_EVENTS is given
We were dropping events before because libdispatch calls kevent with this flag to update a knote without checking for new events; when it did that and we handed it some new events, it would ignore them since they didn't contain `EV_ERROR`, which meant those events were lost forever.
This commit is contained in:
parent
76d8aa3dce
commit
9b4eecbd88
@ -381,7 +381,7 @@ kevent64_impl(int kqfd, const struct kevent64_s *changelist, int nchanges,
|
||||
*/
|
||||
if (nevents > MAX_KEVENT)
|
||||
nevents = MAX_KEVENT;
|
||||
if (nevents > 0) {
|
||||
if ((flags & KEVENT_FLAG_ERROR_EVENTS) == 0 && nevents > 0) {
|
||||
const struct timespec* ts = (flags & KEVENT_FLAG_IMMEDIATE) ? (&timeout_zero) : timeout;
|
||||
again:
|
||||
rv = kqops.kevent_wait(kq, nevents, ts);
|
||||
|
Loading…
Reference in New Issue
Block a user