From e5ecacb20ad3685d6f422c5ed21632fb8b1f7fa0 Mon Sep 17 00:00:00 2001 From: Thomas Klausner Date: Mon, 29 Jul 2013 23:23:41 +0200 Subject: Add default device for Protocol "wskbd". Signed-off-by: Thomas Klausner Reviewed-by: Mark Kettenis Reviewed-by: Matthieu Herrb Signed-off-by: Gaetan Nadon --- 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 b6235d7..d3c3748 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; -- cgit v1.2.1