diff options
| author | Brian Somers <brian@FreeBSD.org> | 2001-05-15 18:12:38 +0000 |
|---|---|---|
| committer | Brian Somers <brian@FreeBSD.org> | 2001-05-15 18:12:38 +0000 |
| commit | eeee064735ccadcb3c8e66099503f80cfb2994c8 (patch) | |
| tree | 9b97f7e55a00e11268d18fdf5c05fd458d87bc14 | |
| parent | dbeed1466fcc7ce11e412a1bfe752f2b4f93e5aa (diff) | |
Notes
| -rw-r--r-- | sys/kern/tty_tty.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/kern/tty_tty.c b/sys/kern/tty_tty.c index 8be458c6dd2a..b17571911031 100644 --- a/sys/kern/tty_tty.c +++ b/sys/kern/tty_tty.c @@ -177,6 +177,8 @@ cttypoll(dev, events, p) static void ctty_clone __P((void *arg, char *name, int namelen, dev_t *dev)); +static dev_t ctty; + static void ctty_clone(void *arg, char *name, int namelen, dev_t *dev) { @@ -187,9 +189,11 @@ ctty_clone(void *arg, char *name, int namelen, dev_t *dev) if (strcmp(name, "tty")) return; vp = cttyvp(curproc); - if (vp == NULL) - return; - *dev = vp->v_rdev; + if (vp == NULL) { + if (ctty) + *dev = ctty; + } else + *dev = vp->v_rdev; } @@ -201,6 +205,7 @@ ctty_drvinit(unused) if (devfs_present) { EVENTHANDLER_REGISTER(dev_clone, ctty_clone, 0, 1000); + ctty = make_dev(&ctty_cdevsw, 0, 0, 0, 0666, "ctty"); } else { make_dev(&ctty_cdevsw, 0, 0, 0, 0666, "tty"); } |
