-
大佬们,我想问一下,为什么要允许EPOLL_CTL_DEL的失败?EPOLL_CTL_DEL在何时会失败呢? void EPollPoller::update(int operation, Channel* channel)
{
struct epoll_event event;
memZero(&event, sizeof event);
event.events = channel->events();
event.data.ptr = channel;
int fd = channel->fd();
LOG_TRACE << "epoll_ctl op = " << operationToString(operation)
<< " fd = " << fd << " event = { " << channel->eventsToString() << " }";
if (::epoll_ctl(epollfd_, operation, fd, &event) < 0)
{
if (operation == EPOLL_CTL_DEL)
{
LOG_SYSERR << "epoll_ctl op =" << operationToString(operation) << " fd =" << fd;
}
else
{
LOG_SYSFATAL << "epoll_ctl op =" << operationToString(operation) << " fd =" << fd;
}
}
}
|
Beta Was this translation helpful? Give feedback.
Answered by
chenshuo
Nov 27, 2023
Replies: 1 comment 1 reply
-
在你提到的这个 commit 之前,是 66ec601 因为 为此只能不把 EPOLL_CTL_DEL 当致命错误。 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
xb1520
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
在你提到的这个 commit 之前,是 66ec601
add curl example.
因为
curl
会自己先 close fd,再通知我们不再关注其上的 event,所以会出现 EPOLL_CTL_DEL 错误。为此只能不把 EPOLL_CTL_DEL 当致命错误。