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);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to