summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authoranton <anton@cvs.openbsd.org>2018-08-30 06:16:31 +0000
committeranton <anton@cvs.openbsd.org>2018-08-30 06:16:31 +0000
commitbd33926f64738d785baae14e33351fb730272f07 (patch)
tree2d32fc06a9c427be6458afa0d69fa3a6f04fd9e8 /sys
parent873d0e0e7da3a95ed04877bbed5c2101111eaa61 (diff)
Remove dead code related to tty allocation for ptys. Back in revision 1.17 of
kern/tty_pty.c, allocation of ptys was made dynamic with the introduction of check_pty(). Every time a new struct pty is allocated its corresponding struct tty is also allocated. It's therefore no longer necessary to ensure that a pty has a tty allocated after calling check_pty(). ok deraadt@ millert@ mpi@ visa@
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/tty_pty.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index 1a561faddaa..f96d699081b 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_pty.c,v 1.89 2018/08/29 06:04:46 anton Exp $ */
+/* $OpenBSD: tty_pty.c,v 1.90 2018/08/30 06:16:30 anton Exp $ */
/* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */
/*
@@ -237,11 +237,7 @@ ptsopen(dev_t dev, int flag, int devtype, struct proc *p)
return (error);
pti = pt_softc[minor(dev)];
- if (!pti->pt_tty) {
- tp = pti->pt_tty = ttymalloc(1000000);
- tp->t_dev = dev;
- } else
- tp = pti->pt_tty;
+ tp = pti->pt_tty;
if ((tp->t_state & TS_ISOPEN) == 0) {
tp->t_state |= TS_WOPEN;
ttychars(tp); /* Set up default chars */
@@ -415,11 +411,7 @@ ptcopen(dev_t dev, int flag, int devtype, struct proc *p)
return (error);
pti = pt_softc[minor(dev)];
- if (!pti->pt_tty) {
- tp = pti->pt_tty = ttymalloc(1000000);
- tp->t_dev = dev;
- } else
- tp = pti->pt_tty;
+ tp = pti->pt_tty;
if (tp->t_oproc)
return (EIO);
tp->t_oproc = ptsstart;