summaryrefslogtreecommitdiffstats
path: root/sys/kern/tty_pty.c
diff options
context:
space:
mode:
authorcognet <cognet@FreeBSD.org>2006-01-26 20:54:49 +0000
committercognet <cognet@FreeBSD.org>2006-01-26 20:54:49 +0000
commit998c2ee892689a421b718d82f1773f89f0c0043e (patch)
tree4ac5399262a11c790573ea69db84506ca2d82bc2 /sys/kern/tty_pty.c
parent8d30a9e919676913a7c5c33b7bff8a00c70cecbf (diff)
downloadFreeBSD-src-998c2ee892689a421b718d82f1773f89f0c0043e.zip
FreeBSD-src-998c2ee892689a421b718d82f1773f89f0c0043e.tar.gz
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
Diffstat (limited to 'sys/kern/tty_pty.c')
-rw-r--r--sys/kern/tty_pty.c3
1 files changed, 2 insertions, 1 deletions
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