extern void reactivate_chan(struct chan *chan, int irq);
extern void chan_enable_winch(struct chan *chan, struct tty_struct *tty);
extern int enable_chan(struct line *line);
-extern void close_chan(struct list_head *chans, int delay_free_irq);
+extern void close_chan(struct line *line);
extern int chan_window_size(struct line *line,
unsigned short *rows_out,
unsigned short *cols_out);
return 0;
out_close:
- close_chan(&line->chan_list, 0);
+ close_chan(line);
return err;
}
chan->fd = -1;
}
-void close_chan(struct list_head *chans, int delay_free_irq)
+void close_chan(struct line *line)
{
struct chan *chan;
* state. Then, the first one opened will have the original state,
* so it must be the last closed.
*/
- list_for_each_entry_reverse(chan, chans, list) {
- close_one_chan(chan, delay_free_irq);
+ list_for_each_entry_reverse(chan, &line->chan_list, list) {
+ close_one_chan(chan, 0);
}
}
if (chan->primary) {
if (tty != NULL)
tty_hangup(tty);
- close_chan(&line->chan_list, 1);
- return;
+ if (line->chan_out != chan)
+ close_one_chan(line->chan_out, 1);
}
- else close_one_chan(chan, 1);
+ close_one_chan(chan, 1);
+ if (chan->primary)
+ return;
}
out:
if (tty)
int i;
for(i = 0; i < nlines; i++)
- close_chan(&lines[i].chan_list, 0);
+ close_chan(&lines[i]);
}
int setup_one_line(struct line *lines, int n, char *init,