while (idx < set->n) {
/* Check sweep state, remove if requested. */
if (set->timeout[idx] > 0 && set->timeout[idx] <= now.tv_sec) {
- const int fd = fdset_get_fd(set, idx);
- if (cb(set, fd, data) == FDSET_SWEEP) {
+ if (cb(set, idx, data) == FDSET_SWEEP) {
(void)fdset_remove(set, idx);
continue;
}
}
/*! \brief Sweep TCP connection. */
-static fdset_sweep_state_t tcp_sweep(fdset_t *set, int fd, _unused_ void *data)
+static fdset_sweep_state_t tcp_sweep(fdset_t *set, int idx, _unused_ void *data)
{
+ const int fd = fdset_get_fd(set, idx);
assert(set && fd >= 0);
/* Best-effort, name and shame. */