| 180 | } |
| 181 | |
| 182 | void aeDeleteFileEvent(aeEventLoop *eventLoop, int fd, int mask) |
| 183 | { |
| 184 | if (fd >= eventLoop->setsize) return; |
| 185 | aeFileEvent *fe = &eventLoop->events[fd]; |
| 186 | if (fe->mask == AE_NONE) return; |
| 187 | |
| 188 | /* We want to always remove AE_BARRIER if set when AE_WRITABLE |
| 189 | * is removed. */ |
| 190 | if (mask & AE_WRITABLE) mask |= AE_BARRIER; |
| 191 | |
| 192 | aeApiDelEvent(eventLoop, fd, mask); |
| 193 | fe->mask = fe->mask & (~mask); |
| 194 | if (fd == eventLoop->maxfd && fe->mask == AE_NONE) { |
| 195 | /* Update the max fd */ |
| 196 | int j; |
| 197 | |
| 198 | for (j = eventLoop->maxfd-1; j >= 0; j--) |
| 199 | if (eventLoop->events[j].mask != AE_NONE) break; |
| 200 | eventLoop->maxfd = j; |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | int aeGetFileEvents(aeEventLoop *eventLoop, int fd) { |
| 205 | if (fd >= eventLoop->setsize) return 0; |
no test coverage detected