diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-07-16 02:38:54 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-16 12:05:38 -0400 |
commit | d14ad81f800a57d3f21f8e98556c728968883e9a (patch) | |
tree | cbe17039283dd51654aaa5a9ac4fae9233285d96 /arch/um/drivers/chan_kern.c | |
parent | 75886f21e3a53a298b097103fd52e83184a89c22 (diff) |
uml: handle errors on opening host side of consoles
If the host side of a console can't be opened, this will now produce visible
error messages.
enable_chan now returns a status and this is passed up to con_open and
ssl_open, which will complain if anything went wrong.
The default host device for the serial line driver is now a pts device rather
than a pty device since lots of hosts have LEGACY_PTYS disabled. This had
always been failing on such hosts, but silently.
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/drivers/chan_kern.c')
-rw-r--r-- | arch/um/drivers/chan_kern.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/arch/um/drivers/chan_kern.c b/arch/um/drivers/chan_kern.c index 3aa351611763..368d3e97dfd9 100644 --- a/arch/um/drivers/chan_kern.c +++ b/arch/um/drivers/chan_kern.c | |||
@@ -203,22 +203,37 @@ void chan_enable_winch(struct list_head *chans, struct tty_struct *tty) | |||
203 | } | 203 | } |
204 | } | 204 | } |
205 | 205 | ||
206 | void enable_chan(struct line *line) | 206 | int enable_chan(struct line *line) |
207 | { | 207 | { |
208 | struct list_head *ele; | 208 | struct list_head *ele; |
209 | struct chan *chan; | 209 | struct chan *chan; |
210 | int err; | ||
210 | 211 | ||
211 | list_for_each(ele, &line->chan_list){ | 212 | list_for_each(ele, &line->chan_list){ |
212 | chan = list_entry(ele, struct chan, list); | 213 | chan = list_entry(ele, struct chan, list); |
213 | if(open_one_chan(chan)) | 214 | err = open_one_chan(chan); |
215 | if (err) { | ||
216 | if (chan->primary) | ||
217 | goto out_close; | ||
218 | |||
214 | continue; | 219 | continue; |
220 | } | ||
215 | 221 | ||
216 | if(chan->enabled) | 222 | if(chan->enabled) |
217 | continue; | 223 | continue; |
218 | line_setup_irq(chan->fd, chan->input, chan->output, line, | 224 | err = line_setup_irq(chan->fd, chan->input, chan->output, line, |
219 | chan); | 225 | chan); |
226 | if (err) | ||
227 | goto out_close; | ||
228 | |||
220 | chan->enabled = 1; | 229 | chan->enabled = 1; |
221 | } | 230 | } |
231 | |||
232 | return 0; | ||
233 | |||
234 | out_close: | ||
235 | close_chan(&line->chan_list, 0); | ||
236 | return err; | ||
222 | } | 237 | } |
223 | 238 | ||
224 | /* Items are added in IRQ context, when free_irq can't be called, and | 239 | /* Items are added in IRQ context, when free_irq can't be called, and |