Skip to content

Commit

Permalink
Fix add_interest when multishot e + oneshot entry
Browse files Browse the repository at this point in the history
  • Loading branch information
beef9999 committed Mar 20, 2024
1 parent a34a0fe commit 9208b9b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion io/epoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,13 @@ class EventEngineEPoll : public MasterEventEngine, public CascadingEventEngine,
if (unlikely(ret < 0 && errno == ENOENT))
ret = ctl(e.fd, EPOLL_CTL_ADD, events);
} else {
if (eint != 0) LOG_ERROR_RETURN(EINVAL, -1, "conflicted interest(s) regarding ONE_SHOT");
if (unlikely(eint != 0))
LOG_ERROR_RETURN(EINVAL, -1, "conflicted interest(s) regarding ONE_SHOT");
ret = ctl(e.fd, EPOLL_CTL_ADD, events);
}
} else {
if (unlikely(eint & ONE_SHOT))
LOG_ERROR_RETURN(EINVAL, -1, "conflicted interest(s) regarding ONE_SHOT");
auto op = (eint & EVENT_RWE) ? EPOLL_CTL_MOD : EPOLL_CTL_ADD;
ret = ctl(e.fd, op, events);
}
Expand Down

0 comments on commit 9208b9b

Please sign in to comment.