summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2012-01-18 18:13:08 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2012-01-18 18:13:08 -0800
commited35abe0da1a9134ee126df88608b33892ae4313 (patch)
tree90cf8f9565682b0b7bef59986a4439b822e9f5d3
parenta6a0dee4178600a5a9403f69c22bd4eb483fbd34 (diff)
downloadxorg-driver-xf86-input-keyboard-ed35abe0da1a9134ee126df88608b33892ae4313.tar.gz
Solaris: Use uchar_t, not int, for led masks in KIOCSLED/KIOCGLED ioctls
Avoids checking/setting the wrong bits on big endian machines like SPARC. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/sun_kbd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/sun_kbd.c b/src/sun_kbd.c
index a240087..5f7b5c6 100644
--- a/src/sun_kbd.c
+++ b/src/sun_kbd.c
@@ -70,8 +70,9 @@ static void
sunKbdSetLeds(InputInfoPtr pInfo, int leds)
{
int i;
+ uchar_t setleds = (uchar_t) (leds & 0xFF);
- SYSCALL(i = ioctl(pInfo->fd, KIOCSLED, &leds));
+ SYSCALL(i = ioctl(pInfo->fd, KIOCSLED, &setleds));
if (i < 0) {
xf86Msg(X_ERROR, "%s: Failed to set keyboard LED's: %s\n",
pInfo->name, strerror(errno));
@@ -82,14 +83,15 @@ sunKbdSetLeds(InputInfoPtr pInfo, int leds)
static int
sunKbdGetLeds(InputInfoPtr pInfo)
{
- int i, leds = 0;
+ int i;
+ uchar_t leds = 0;
SYSCALL(i = ioctl(pInfo->fd, KIOCGLED, &leds));
if (i < 0) {
xf86Msg(X_ERROR, "%s: Failed to get keyboard LED's: %s\n",
pInfo->name, strerror(errno));
}
- return leds;
+ return (int) leds;
}