Properly use return value of select to count the number of events
This commit is contained in:
+2
-1
@@ -168,17 +168,18 @@ again:
|
||||
}
|
||||
|
||||
if (FD_ISSET(mux->descriptors[i]->fd, &read_set)) {
|
||||
rc--;
|
||||
events |= MUX_EV_READ;
|
||||
}
|
||||
|
||||
if (FD_ISSET(mux->descriptors[i]->fd, &write_set)) {
|
||||
rc--;
|
||||
events |= MUX_EV_WRITE;
|
||||
}
|
||||
|
||||
if (events) {
|
||||
assert(mux->descriptors[i]->callback != NULL);
|
||||
mux->descriptors[i]->callback(mux_, mux->descriptors[i], events);
|
||||
rc--;
|
||||
event_cnt++;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user