Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 280664
b: refs/heads/master
c: 2cd0050
h: refs/heads/master
v: v3
  • Loading branch information
Jiri Slaby authored and Greg Kroah-Hartman committed Nov 15, 2011
1 parent abe5fe2 commit bb25689
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ba5db44895ec3abc5317a9af86001e688a72185c
refs/heads/master: 2cd0050cf3ec4da847c3a2f7d95cffd548aef39d
19 changes: 11 additions & 8 deletions trunk/drivers/tty/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1841,32 +1841,35 @@ static struct tty_driver *tty_lookup_driver(dev_t device, struct file *filp,
{
struct tty_driver *driver;

switch (device) {
#ifdef CONFIG_VT
if (device == MKDEV(TTY_MAJOR, 0)) {
case MKDEV(TTY_MAJOR, 0): {
extern struct tty_driver *console_driver;
driver = tty_driver_kref_get(console_driver);
*index = fg_console;
*noctty = 1;
return driver;
break;
}
#endif
if (device == MKDEV(TTYAUX_MAJOR, 1)) {
case MKDEV(TTYAUX_MAJOR, 1): {
struct tty_driver *console_driver = console_device(index);
if (console_driver) {
driver = tty_driver_kref_get(console_driver);
if (driver) {
/* Don't let /dev/console block */
filp->f_flags |= O_NONBLOCK;
*noctty = 1;
return driver;
break;
}
}
return ERR_PTR(-ENODEV);
}

driver = get_tty_driver(device, index);
if (!driver)
return ERR_PTR(-ENODEV);
default:
driver = get_tty_driver(device, index);
if (!driver)
return ERR_PTR(-ENODEV);
break;
}
return driver;
}

Expand Down

0 comments on commit bb25689

Please sign in to comment.