… | |
… | |
88 | ev.data.u64 = (uint64_t)(uint32_t)fd |
88 | ev.data.u64 = (uint64_t)(uint32_t)fd |
89 | | ((uint64_t)(uint32_t)++anfds [fd].egen << 32); |
89 | | ((uint64_t)(uint32_t)++anfds [fd].egen << 32); |
90 | ev.events = (nev & EV_READ ? EPOLLIN : 0) |
90 | ev.events = (nev & EV_READ ? EPOLLIN : 0) |
91 | | (nev & EV_WRITE ? EPOLLOUT : 0); |
91 | | (nev & EV_WRITE ? EPOLLOUT : 0); |
92 | |
92 | |
93 | if (expect_true (!epoll_ctl (backend_fd, oev ? EPOLL_CTL_MOD : EPOLL_CTL_ADD, fd, &ev))) |
93 | if (expect_true (!epoll_ctl (backend_fd, oev && oldmask != nev ? EPOLL_CTL_MOD : EPOLL_CTL_ADD, fd, &ev))) |
94 | return; |
94 | return; |
95 | |
95 | |
96 | if (expect_true (errno == ENOENT)) |
96 | if (expect_true (errno == ENOENT)) |
97 | { |
97 | { |
98 | /* if ENOENT then the fd went away, so try to do the right thing */ |
98 | /* if ENOENT then the fd went away, so try to do the right thing */ |