Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/sysinst Do not try to change the keyboard layout if...



details:   https://anonhg.NetBSD.org/src/rev/f9b4e1a2d359
branches:  trunk
changeset: 847160:f9b4e1a2d359
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Dec 13 12:05:11 2019 +0000

description:
Do not try to change the keyboard layout if we are not running on the
console.

diffstat:

 usr.sbin/sysinst/wskbd.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (32 lines):

diff -r a17bb22ff96a -r f9b4e1a2d359 usr.sbin/sysinst/wskbd.c
--- a/usr.sbin/sysinst/wskbd.c  Fri Dec 13 08:30:26 2019 +0000
+++ b/usr.sbin/sysinst/wskbd.c  Fri Dec 13 12:05:11 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wskbd.c,v 1.3 2019/06/22 20:46:07 christos Exp $       */
+/*     $NetBSD: wskbd.c,v 1.4 2019/12/13 12:05:11 martin Exp $ */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: wskbd.c,v 1.3 2019/06/22 20:46:07 christos Exp $");
+__RCSID("$NetBSD: wskbd.c,v 1.4 2019/12/13 12:05:11 martin Exp $");
 
 #include <unistd.h>
 #include <stdlib.h>
@@ -93,6 +93,13 @@
        menu_ent opt[__arraycount(kb_types)];
        const char *dflt = msg_string(MSG_kb_default);
 
+       /*
+        * Check if we are running on a wscons keyboard at all,
+        * do not bother to try changing the layout if not.
+        */
+       if (ioctl(0, WSKBDIO_GTYPE,  &i) == -1)
+               return;
+
        memset(opt, 0, sizeof(opt));
        fd = open("/dev/wskbd0", O_WRONLY);
        if (fd < 0)



Home | Main Index | Thread Index | Old Index