# HG changeset patch # User Alan Coopersmith # Date 1327026134 28800 # Node ID 12852db78e0ea5919f24010eefee8795aebdba28 # Parent 944af4a4a9dd615a4964c712e8d03ffeabd6648b 6892399 Keyboard LEDs do not function under Xorg on SPARC diff -r 944af4a4a9dd -r 12852db78e0e open-src/driver/xf86-input-keyboard/Makefile --- a/open-src/driver/xf86-input-keyboard/Makefile Wed Jan 18 14:10:54 2012 -0800 +++ b/open-src/driver/xf86-input-keyboard/Makefile Thu Jan 19 18:22:14 2012 -0800 @@ -2,7 +2,7 @@ # # xf86-input-keyboard 1.x Makefile # -# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), @@ -36,7 +36,7 @@ TARBALL_SHA1 = 8e845086749f8c4b64fdfa852b4b26cf7bb62dc9 # Patches to apply to source after unpacking, in order -SOURCE_PATCHES = +SOURCE_PATCHES = leds.patch,-p1 # Man pages to apply Sun footer to & attributes to list SUNTOUCHED_MANPAGES=man/*.man diff -r 944af4a4a9dd -r 12852db78e0e open-src/driver/xf86-input-keyboard/leds.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/open-src/driver/xf86-input-keyboard/leds.patch Thu Jan 19 18:22:14 2012 -0800 @@ -0,0 +1,48 @@ +From ed35abe0da1a9134ee126df88608b33892ae4313 Mon Sep 17 00:00:00 2001 +From: Alan Coopersmith +Date: Wed, 18 Jan 2012 18:13:08 -0800 +Subject: [PATCH:xf86-input-keyboard] 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 +--- + src/sun_kbd.c | 8 +++++--- + 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; + } + + +-- +1.7.3.2 +