aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Long <scottl@FreeBSD.org>2005-05-07 17:51:09 +0000
committerScott Long <scottl@FreeBSD.org>2005-05-07 17:51:09 +0000
commitbbe327aea67f046183f949450d6271765b9ebfb0 (patch)
treea7d14e540c0fa15b9155848b50d0e813b51e6a3c
parent5ba518022ab3bbe683ab48dfa526ebd2b643fe29 (diff)
Revert 1.228.2.2.2.1, it causes more problems than it fixes.release/5.4.0
Approved by: re
Notes
Notes: svn path=/releng/5.4/; revision=145986 svn path=/release/5.4.0/; revision=145987; tag=release/5.4.0
-rw-r--r--sys/kern/tty.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index b02b4bf5f964..fa3fe3f9fbfa 100644
--- a/sys/kern/tty.c
+++ b/sys/kern/tty.c
@@ -2748,7 +2748,7 @@ ttyrel(struct tty *tp)
("ttyrel(): tty refcnt is %d (%s)",
tp->t_refcnt, tp->t_dev != NULL ? devtoname(tp->t_dev) : "??"));
i = --tp->t_refcnt;
- if (i > 0) {
+ if (i != 0) {
mtx_unlock(&tp->t_mtx);
mtx_unlock(&tty_list_mutex);
return (i);
@@ -2783,17 +2783,7 @@ ttymalloc(struct tty *tp)
* XXX: require it and do a ttyrel(tp) here and allocate
* XXX: a new tty. For now do nothing.
*/
- /*
- * If ttyrel() will recycle the tty, go ahead
- * and let it. Otherwise conform to the old behavior.
- * The console device in particular ends up here with
- * positive refcounts, and destroying it really messes
- * up init.
- */
- if(tp->t_refcnt <= 1)
- ttyrel(tp);
- else
- return(tp);
+ return(tp);
}
tp = malloc(sizeof *tp, M_TTYS, M_WAITOK | M_ZERO);
tp->t_timeout = -1;