summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/tty_pts.c8
-rw-r--r--sys/kern/tty_pty.c3
2 files changed, 8 insertions, 3 deletions
diff --git a/sys/kern/tty_pts.c b/sys/kern/tty_pts.c
index 2f409b7..19a12c0 100644
--- a/sys/kern/tty_pts.c
+++ b/sys/kern/tty_pts.c
@@ -444,8 +444,12 @@ ptcopen(struct cdev *dev, int flag, int devtype, struct thread *td)
* XXX: Might want to make the ownership/permissions here more
* configurable.
*/
- pt->pt_devs = devs = make_dev_cred(&pts_cdevsw, pt->pt_num,
- td->td_ucred, UID_ROOT, GID_WHEEL, 0666, "pts/%d", pt->pt_num);
+ if (pt->pt_devs)
+ devs = pt->pt_devs;
+ else
+ pt->pt_devs = devs = make_dev_cred(&pts_cdevsw, pt->pt_num,
+ td->td_ucred, UID_ROOT, GID_WHEEL, 0666, "pts/%d",
+ pt->pt_num);
devs->si_drv1 = pt;
devs->si_tty = pt->pt_tty;
pt->pt_tty->t_dev = devs;
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index 643f0c4..2cc1d0f 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -327,7 +327,8 @@ ptcopen(struct cdev *dev, int flag, int devtype, struct thread *td)
pt->pt_send = 0;
pt->pt_ucntl = 0;
- pty_create_slave(td->td_ucred, pt, minor(dev));
+ if (!pt->devs)
+ pty_create_slave(td->td_ucred, pt, minor(dev));
pt->pt_devc_open = 1;
return (0);
OpenPOWER on IntegriCloud