- for (i= 0; i < fd_num; i++)
- if (FD_ISSET(i, &active_set))
- {
- class cl_console *c;
- int j;
- for (j= 0; j < cons->count; j++)
- {
- c= (class cl_console*)(cons->at(j));
- if (c->match(i))
- {
- actual_console= c;
- int retval= c->proc_input(cmdset);
- if (retval)
- {
- del_console(c);
- delete c;
- }
- actual_console= 0;
- return(cons->count == 0);
- }
- }
- }
- return(0);
+ int fd = c->get_in_fd();
+ if (fd >= 0 && FD_ISSET(fd, &active_set))
+ {
+ actual_console = c;
+ int retval = c->proc_input(cmdset);
+ if (retval)
+ {
+ del_console(c);
+ delete c;
+ }
+ actual_console = 0;
+ return(0 == cons->count);
+ }
+ }
+ return 0;