diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2008-11-11 17:35:55 -0800 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2008-11-11 17:35:55 -0800 |
commit | 74b6461c5362e3401fdcf5a080bf71e6f7908e09 (patch) | |
tree | 362f894f545131ea9986227e552469860936e064 | |
parent | 3e28d68b50d291938734e9684b8296ca864f3892 (diff) |
sun_kbd.c: Don't try to repeat shutdown actions on already closed keyboard
-rw-r--r-- | src/sun_kbd.c | 8 | ||||
-rw-r--r-- | src/sun_kbd.h | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/sun_kbd.c b/src/sun_kbd.c index f8eedfe..cc43022 100644 --- a/src/sun_kbd.c +++ b/src/sun_kbd.c @@ -219,8 +219,11 @@ KbdOff(InputInfoPtr pInfo, int what) int i; /* restore original state */ - - sunKbdSetLeds(pInfo, priv->oleds); + + if (priv->oleds != -1) { + sunKbdSetLeds(pInfo, priv->oleds); + priv->oleds = -1; + } if (priv->otranslation != -1) { SYSCALL(i = ioctl(pInfo->fd, KIOCTRANS, &priv->otranslation)); @@ -251,6 +254,7 @@ KbdOff(InputInfoPtr pInfo, int what) "%s: cannot pop module '%s' off keyboard device: %s\n", pInfo->name, priv->strmod, strerror(errno)); } + priv->strmod = NULL; } return Success; diff --git a/src/sun_kbd.h b/src/sun_kbd.h index 1c50993..a73e201 100644 --- a/src/sun_kbd.h +++ b/src/sun_kbd.h @@ -34,7 +34,7 @@ typedef struct { Bool kbdActive; /* Have we set kbd modes for X? */ int otranslation; /* Original translation mode */ int odirect; /* Original "direct" mode setting */ - unsigned char oleds; /* Original LED state */ + int oleds; /* Original LED state */ const char * strmod; /* Streams module pushed on kbd device */ } sunKbdPrivRec, *sunKbdPrivPtr; |