- for(iofd = first_descriptor; iofd; iofd = tmp_iofd) {
- tmp_iofd = iofd->next;
- if(iofd->type == IOTYPE_SERVER || iofd->type == IOTYPE_CLIENT || iofd->type == IOTYPE_STDIN) {
- if(FD_ISSET(iofd->fd, &read_fds) || FD_ISSET(iofd->fd, &write_fds)) {
- iohandler_events(iofd, FD_ISSET(iofd->fd, &read_fds), FD_ISSET(iofd->fd, &write_fds));
+ for(iold = first_descriptor; iold; iold = tmp_iold) {
+ tmp_iold = iold->next;
+ iofd = IOLOWLEVEL_GET_IOFD(iold);
+ if((iofd && iofd->type == IOTYPE_STDIN) || iold->fd >= 0) {
+ if(FD_ISSET(iold->fd, &read_fds) || FD_ISSET(iold->fd, &write_fds)) {
+ if(iofd)
+ iohandler_events(iofd, FD_ISSET(iofd->fd, &read_fds), FD_ISSET(iofd->fd, &write_fds));
+ else
+ iold->data.callback(iold, FD_ISSET(iofd->fd, &read_fds), FD_ISSET(iofd->fd, &write_fds));