Fix iomux_select_recalc_max, it went to an infinite loop.

This commit is contained in:
Nils O. Selåsdal
2015-05-11 23:09:40 +02:00
parent a7516141dd
commit a87558047b
+3 -4
View File
@@ -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)
{
size_t i;
size_t n;
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) {
mux->max_fd = UC_MAX(mux->descriptors[i]->fd, mux->max_fd);
i++;
n++;
}
assert(i < FD_SETSIZE);
}
}