[PATCH:xf86-input-keyboard 15/21] Fix Protocol "standard".

Thomas Klausner wiz at NetBSD.org
Fri Jul 26 14:24:10 PDT 2013


Only default to /dev/wskbd if Protocol is set to wskbd. Now Protocol
"standard" should work again.

>From Michael Lorenz <macallan at NetBSD.org>
Signed-off-by: Thomas Klausner <wiz at NetBSD.org>
---
 src/bsd_kbd.c | 20 +++++++++-----------
 1 file changed, 9 insertions(+), 11 deletions(-)

diff --git a/src/bsd_kbd.c b/src/bsd_kbd.c
index 6a3ca79..b9cca5f 100644
--- a/src/bsd_kbd.c
+++ b/src/bsd_kbd.c
@@ -359,20 +359,18 @@ OpenKeyboard(InputInfoPtr pInfo)
     }
     free(s);
 
-    s = xf86SetStrOption(pInfo->options, "Device", NULL);
+    if (prot == PROT_WSCONS) {
+	s = xf86SetStrOption(pInfo->options, "Device", "/dev/wskbd");
+    } else
+	s = xf86SetStrOption(pInfo->options, "Device", NULL);
+
     if (s == NULL) {
-       if (prot == PROT_WSCONS) {
-           xf86Msg(X_ERROR,"A \"device\" option is required with"
-                                  " the \"wskbd\" keyboard protocol\n");
-           return FALSE;
-       } else {
-           pInfo->fd = xf86Info.consoleFd;
-           pKbd->isConsole = TRUE;
-           pKbd->consType = xf86Info.consType;
-       }
+	pInfo->fd = xf86Info.consoleFd;
+	pKbd->isConsole = TRUE;
+	pKbd->consType = xf86Info.consType;
     } else {
 	pInfo->fd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL);
-       if (pInfo->fd == -1) {
+	if (pInfo->fd == -1) {
            xf86Msg(X_ERROR, "%s: cannot open \"%s\"\n", pInfo->name, s);
            free(s);
            return FALSE;
-- 
1.8.3.3



More information about the xorg-devel mailing list