Don't attempt to re-create the /dev entry for the slave part if it already
exist when opening the master. This can happen if one open the master, then open the slave, then close and re-open the master. Reported by: Peter Holm
This commit is contained in:
parent
3acb8d3f94
commit
169c44907a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=154868
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user