summaryrefslogtreecommitdiff
path: root/sys/kern/tty_pty.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2003-10-03 16:44:52 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2003-10-03 16:44:52 +0000
commit24c386b577f126bce761c7288e987ae93c36aa88 (patch)
tree99166e0d499a2be11543cc5dd9774c63a12466eb /sys/kern/tty_pty.c
parente43c66ff4e929d0beb6716fb882523dc136b8c0c (diff)
Merge tty_attach() in ttymalloc() and tty_detach() in ttyfree(). The need for
separate tty registering is gone now that sparc has switched to wscons, and this makes the code less error-prone. Also, remove tests for ttymalloc() failure, since it uses M_WAITOK. ok millert@ deraadt@, tested by various people as well besides me...
Diffstat (limited to 'sys/kern/tty_pty.c')
-rw-r--r--sys/kern/tty_pty.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index 6cb8615f724..a77c60c108f 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_pty.c,v 1.15 2003/09/23 16:51:12 millert Exp $ */
+/* $OpenBSD: tty_pty.c,v 1.16 2003/10/03 16:44:51 miod Exp $ */
/* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */
/*
@@ -116,9 +116,7 @@ ptsopen(dev, flag, devtype, p)
pti = &pt_softc[minor(dev)];
if (!pti->pt_tty) {
tp = pti->pt_tty = ttymalloc();
- tty_attach(tp);
- }
- else
+ } else
tp = pti->pt_tty;
if ((tp->t_state & TS_ISOPEN) == 0) {
tp->t_state |= TS_WOPEN;
@@ -312,9 +310,7 @@ ptcopen(dev, flag, devtype, p)
pti = &pt_softc[minor(dev)];
if (!pti->pt_tty) {
tp = pti->pt_tty = ttymalloc();
- tty_attach(tp);
- }
- else
+ } else
tp = pti->pt_tty;
if (tp->t_oproc)
return (EIO);