From owner-svn-src-head@freebsd.org Mon Aug 15 17:08:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75544BBBF43; Mon, 15 Aug 2016 17:08:26 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 45D3D1F0E; Mon, 15 Aug 2016 17:08:26 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7FH8PRc046275; Mon, 15 Aug 2016 17:08:25 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7FH8Pfp046274; Mon, 15 Aug 2016 17:08:25 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201608151708.u7FH8Pfp046274@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Mon, 15 Aug 2016 17:08:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304165 - head/sys/dev/syscons X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 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: Mon, 15 Aug 2016 17:08:26 -0000 Author: bde Date: Mon Aug 15 17:08:25 2016 New Revision: 304165 URL: https://svnweb.freebsd.org/changeset/base/304165 Log: Like scr_lock, the grab count needs to be per-physical-device to work. This bug corrupted the grab count on both vtys if the ungrabbed vty is different from the console, and failed to restore the keyboard state on the ungrabbed vty, but not restoring the latter usually left the keyboard mode part of it uncorrupted at 1 (K_XLATE), while after this fix the keyboard mode part is usually corrupted to 0 (K_RAW). While here, rename the grab count from 'grabbed' to grab_level. Modified: head/sys/dev/syscons/syscons.c Modified: head/sys/dev/syscons/syscons.c ============================================================================== --- head/sys/dev/syscons/syscons.c Mon Aug 15 15:34:53 2016 (r304164) +++ head/sys/dev/syscons/syscons.c Mon Aug 15 17:08:25 2016 (r304165) @@ -1661,7 +1661,7 @@ sc_cngrab(struct consdev *cp) if (scp->sc->kbd == NULL) return; - if (scp->grabbed++ > 0) + if (scp->sc->grab_level++ > 0) return; /* @@ -1687,7 +1687,7 @@ sc_cnungrab(struct consdev *cp) if (scp->sc->kbd == NULL) return; - if (--scp->grabbed > 0) + if (--scp->sc->grab_level > 0) return; kbdd_poll(scp->sc->kbd, FALSE);