Fix iomux_select_recalc_max, it went to an infinite loop.
This commit is contained in:
+3
-4
@@ -27,15 +27,14 @@ static int iomux_select_update_events(struct IOMux *mux_, struct IOMuxFD *fd);
|
|||||||
static void iomux_select_recalc_max(struct IOMuxSelect *mux)
|
static void iomux_select_recalc_max(struct IOMuxSelect *mux)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
size_t n;
|
||||||
mux->max_fd = -1;
|
mux->max_fd = -1;
|
||||||
|
|
||||||
for (i = 0; i < mux->num_descriptors; ) {
|
for (i = 0, n = 0; i < FD_SETSIZE && n < mux->num_descriptors; i++) {
|
||||||
if (mux->descriptors[i] != NULL) {
|
if (mux->descriptors[i] != NULL) {
|
||||||
mux->max_fd = UC_MAX(mux->descriptors[i]->fd, mux->max_fd);
|
mux->max_fd = UC_MAX(mux->descriptors[i]->fd, mux->max_fd);
|
||||||
i++;
|
n++;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(i < FD_SETSIZE);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user