for (channel = 0; channel <= max_input_desc; ++channel)
{
struct fd_callback_data *d = &fd_callback_info[channel];
- if (d->func
- && ((d->condition & FOR_READ
- && FD_ISSET (channel, &Available))
- || (d->condition & FOR_WRITE
- && FD_ISSET (channel, &write_mask))))
+ if (d->func)
{
- d->func (channel, d->data);
- FD_CLR (channel, &Available);
+ if (d->condition & FOR_READ
+ && FD_ISSET (channel, &Available))
+ {
+ d->func (channel, d->data);
+ FD_CLR (channel, &Available);
+ }
+ else if (d->condition & FOR_WRITE
+ && FD_ISSET (channel, &write_mask))
+ d->func (channel, d->data);
}
}