summaryrefslogtreecommitdiff
path: root/sys/dev/wscons/wskbd.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2002-05-20 23:29:40 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2002-05-20 23:29:40 +0000
commit6439941f3d904910e7b59ed8d9fc5e499b0a4d6f (patch)
tree431b90725bd2c0bd4c632c8404f51ec334ef9dc4 /sys/dev/wscons/wskbd.c
parentb2a7fd194eceff2b87de78d7cec611dbe9852f58 (diff)
Do not blindly call wsdisplay routines if no wsdisplay device is active
and the user presses a magic key. ok mickey@
Diffstat (limited to 'sys/dev/wscons/wskbd.c')
-rw-r--r--sys/dev/wscons/wskbd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sys/dev/wscons/wskbd.c b/sys/dev/wscons/wskbd.c
index 54b54d13ea1..4e97cf71d02 100644
--- a/sys/dev/wscons/wskbd.c
+++ b/sys/dev/wscons/wskbd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wskbd.c,v 1.32 2002/04/30 23:01:55 mickey Exp $ */
+/* $OpenBSD: wskbd.c,v 1.33 2002/05/20 23:29:39 miod Exp $ */
/* $NetBSD: wskbd.c,v 1.38 2000/03/23 07:01:47 thorpej Exp $ */
/*
@@ -1421,13 +1421,17 @@ internal_command(sc, type, ksym, ksym2)
case KS_Cmd_Screen9:
case KS_Cmd_Screen10:
case KS_Cmd_Screen11:
- wsdisplay_switch(sc->sc_displaydv, ksym - KS_Cmd_Screen0, 0);
+ if (sc->sc_displaydv != NULL)
+ wsdisplay_switch(sc->sc_displaydv,
+ ksym - KS_Cmd_Screen0, 0);
return (1);
case KS_Cmd_ResetEmul:
- wsdisplay_reset(sc->sc_displaydv, WSDISPLAY_RESETEMUL);
+ if (sc->sc_displaydv != NULL)
+ wsdisplay_reset(sc->sc_displaydv, WSDISPLAY_RESETEMUL);
return (1);
case KS_Cmd_ResetClose:
- wsdisplay_reset(sc->sc_displaydv, WSDISPLAY_RESETCLOSE);
+ if (sc->sc_displaydv != NULL)
+ wsdisplay_reset(sc->sc_displaydv, WSDISPLAY_RESETCLOSE);
return (1);
#ifdef __i386__
case KS_Cmd_KbdReset: