diff options
Diffstat (limited to 'sys/dev/kbdmux')
-rw-r--r-- | sys/dev/kbdmux/kbdmux.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/dev/kbdmux/kbdmux.c b/sys/dev/kbdmux/kbdmux.c index 844baa7..3080cf2 100644 --- a/sys/dev/kbdmux/kbdmux.c +++ b/sys/dev/kbdmux/kbdmux.c @@ -246,7 +246,16 @@ kbdmux_kbd_event(keyboard_t *kbd, int event, void *arg) KBDMUX_LOCK(state); - /* read all chars from the keyboard */ + /* + * Read all chars from the keyboard + * + * Turns out that atkbd(4) check_char() method may return + * "true" while read_char() method returns NOKEY. If this + * happens we could stuck in the loop below. Avoid this + * by breaking out of the loop if read_char() method returns + * NOKEY. + */ + while (KBDMUX_CHECK_CHAR(kbd)) { c = KBDMUX_READ_CHAR(kbd, 0); if (c == NOKEY) @@ -1128,8 +1137,8 @@ kbdmux_ioctl(keyboard_t *kbd, u_long cmd, caddr_t arg) break; case PIO_KEYMAP: /* set keyboard translation table */ - case PIO_KEYMAPENT: /* set keyboard translation table entry */ - case PIO_DEADKEYMAP: /* set accent key translation table */ + case PIO_KEYMAPENT: /* set keyboard translation table entry */ + case PIO_DEADKEYMAP: /* set accent key translation table */ KBDMUX_LOCK(state); state->ks_accents = 0; |