* Returns the index in the fdset for a given fd. * @return * index for the fd, or -1 if fd isn't in the fdset. */
| 66 | * index for the fd, or -1 if fd isn't in the fdset. |
| 67 | */ |
| 68 | static int |
| 69 | fdset_find_fd(struct fdset *pfdset, int fd) |
| 70 | { |
| 71 | int i; |
| 72 | |
| 73 | for (i = 0; i < pfdset->num && pfdset->fd[i].fd != fd; i++) |
| 74 | ; |
| 75 | |
| 76 | return i == pfdset->num ? -1 : i; |
| 77 | } |
| 78 | |
| 79 | static void |
| 80 | fdset_add_fd(struct fdset *pfdset, int idx, int fd, |
no outgoing calls
no test coverage detected