Date: Mon, 15 Aug 2016 17:08:25 +0000 (UTC) From: Bruce Evans <bde@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304165 - head/sys/dev/syscons Message-ID: <201608151708.u7FH8Pfp046274@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608151708.u7FH8Pfp046274>