From owner-svn-src-head@FreeBSD.ORG Fri Jun 12 20:29:56 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EF401065670; Fri, 12 Jun 2009 20:29:56 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3C59B8FC26; Fri, 12 Jun 2009 20:29:56 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n5CKTu2r091992; Fri, 12 Jun 2009 20:29:56 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n5CKTu2I091991; Fri, 12 Jun 2009 20:29:56 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <200906122029.n5CKTu2I091991@svn.freebsd.org> From: Ed Schouten Date: Fri, 12 Jun 2009 20:29:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r194074 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Jun 2009 20:29:57 -0000 Author: ed Date: Fri Jun 12 20:29:55 2009 New Revision: 194074 URL: http://svn.freebsd.org/changeset/base/194074 Log: Prevent yet another staircase effect bug in the console device. Even though I thought I fixed the staircase issue (and I was no longer able to reproduce it), I got some reports of the issue still being there. It turns out the staircase effect still occurred when /dev/console was kept open while killing the getty on the same TTY (ttyv0). For some reason I can't figure out how the old TTY code dealt with that, so I assume the issue has always been there. I only exposed it more by merging consolectl with ttyv0, which means that the issue was present, even on systems without a serial console. I'm now marking the console device as being closed when closing the regular TTY device node. This means that when the getty shuts down, init(8) will open /dev/console, which means the termios attributes will always be reset in this case. Modified: head/sys/kern/tty.c Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Fri Jun 12 20:18:08 2009 (r194073) +++ head/sys/kern/tty.c Fri Jun 12 20:29:55 2009 (r194074) @@ -322,14 +322,14 @@ ttydev_close(struct cdev *dev, int fflag * console. */ MPASS((tp->t_flags & TF_OPENED) != TF_OPENED); - if (dev == dev_console) + if (dev == dev_console) { tp->t_flags &= ~TF_OPENED_CONS; - else - tp->t_flags &= ~(TF_OPENED_IN|TF_OPENED_OUT); - - if (tp->t_flags & TF_OPENED) { - tty_unlock(tp); - return (0); + if (tp->t_flags & TF_OPENED) { + tty_unlock(tp); + return (0); + } + } else { + tp->t_flags &= ~TF_OPENED; } /*