From 830d1bb20529facd02dae2b698d2ea5c64c4a58f Mon Sep 17 00:00:00 2001 From: jmcneill Date: Mon, 18 Dec 2017 18:57:21 +0000 Subject: [PATCH] If the wskbd driver returns type 0, return "no data" from wskbd_cngetc --- sys/dev/wscons/wskbd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/wscons/wskbd.c b/sys/dev/wscons/wskbd.c index bac5e4dbd865..28791d878853 100644 --- a/sys/dev/wscons/wskbd.c +++ b/sys/dev/wscons/wskbd.c @@ -1,4 +1,4 @@ -/* $NetBSD: wskbd.c,v 1.140 2017/06/13 00:42:27 nat Exp $ */ +/* $NetBSD: wskbd.c,v 1.141 2017/12/18 18:57:21 jmcneill Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -105,7 +105,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.140 2017/06/13 00:42:27 nat Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.141 2017/12/18 18:57:21 jmcneill Exp $"); #ifdef _KERNEL_OPT #include "opt_ddb.h" @@ -1400,6 +1400,10 @@ wskbd_cngetc(dev_t dev) (*wskbd_console_data.t_consops->getc) (wskbd_console_data.t_consaccesscookie, &type, &data); + if (type == 0) { + /* No data returned */ + return 0; + } if (type == WSCONS_EVENT_ASCII) { /* * We assume that when the driver falls back