diff options
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r-- | sys/kern/tty.c | 14 |
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; |