diff options
-rw-r--r-- | src/sun_kbd.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sun_kbd.c b/src/sun_kbd.c index 1c87a24..bb831c1 100644 --- a/src/sun_kbd.c +++ b/src/sun_kbd.c @@ -65,6 +65,7 @@ #include <sys/kbd.h> static int KbdOn(InputInfoPtr pInfo, int what); +static Bool OpenKeyboard(InputInfoPtr pInfo); static void CloseKeyboard(InputInfoPtr pInfo); static void @@ -172,6 +173,12 @@ KbdOn(InputInfoPtr pInfo, int what) return Success; } + if (pInfo->fd == -1) { + if (!OpenKeyboard(pInfo)) { + return BadImplementation; + } + } + if (priv->strmod) { SYSCALL(i = ioctl(pInfo->fd, I_PUSH, priv->strmod)); if (i < 0) { |