summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2005-08-26 07:24:21 +0000
committerDaniel Stone <daniel@fooishbar.org>2005-08-26 07:24:21 +0000
commit89c84575ea905c7598d6b6029c9209abe1cfb074 (patch)
treef62e70e2af92e3056cb32b39d2b097693c8e75c5
parentbb5e934df7f23fb365ed673a12d283ff52af79c0 (diff)
downloadxserver-89c84575ea905c7598d6b6029c9209abe1cfb074.tar.gz
Undo rate/period change after function body, so the damage doesn't leak
into other functions. (Debian #050)
-rw-r--r--hw/xfree86/os-support/linux/lnx_io.c11
-rw-r--r--hw/xfree86/os-support/linux/lnx_kbd.c13
2 files changed, 22 insertions, 2 deletions
diff --git a/hw/xfree86/os-support/linux/lnx_io.c b/hw/xfree86/os-support/linux/lnx_io.c
index 8d1fb456b..47df0dfb6 100644
--- a/hw/xfree86/os-support/linux/lnx_io.c
+++ b/hw/xfree86/os-support/linux/lnx_io.c
@@ -77,7 +77,9 @@ xf86GetKbdLeds()
#include <asm/kbio.h>
#endif
-/* Deal with spurious kernel header change */
+/* Deal with spurious kernel header change in struct kbd_repeat.
+ We undo this define after the routine using that struct is over,
+ so as not to interfere with other 'rate' elements. */
#if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
# define rate period
@@ -120,6 +122,13 @@ KDKBDREP_ioctl_ok(int rate, int delay) {
#undef rate
+/* Undo the earlier define for the struct kbd_repeat problem. */
+#if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
+# undef rate
+# endif
+#endif
+
static int
KIOCSRATE_ioctl_ok(int rate, int delay) {
#ifdef KIOCSRATE
diff --git a/hw/xfree86/os-support/linux/lnx_kbd.c b/hw/xfree86/os-support/linux/lnx_kbd.c
index dd6773fff..b1fc95b56 100644
--- a/hw/xfree86/os-support/linux/lnx_kbd.c
+++ b/hw/xfree86/os-support/linux/lnx_kbd.c
@@ -107,7 +107,9 @@ GetKbdLeds(InputInfoPtr pInfo)
#include <asm/kbio.h>
#endif
-/* Deal with spurious kernel header change */
+/* Deal with spurious kernel header change in struct kbd_repeat.
+ We undo this define after the routine using that struct is over,
+ so as not to interfere with other 'rate' elements. */
#if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
# define rate period
@@ -151,6 +153,13 @@ KDKBDREP_ioctl_ok(int rate, int delay) {
#undef rate
+/* Undo the earlier define for the struct kbd_repeat problem. */
+#if defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
+# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
+# undef rate
+# endif
+#endif
+
static int
KIOCSRATE_ioctl_ok(int rate, int delay) {
#ifdef KIOCSRATE
@@ -178,6 +187,8 @@ KIOCSRATE_ioctl_ok(int rate, int delay) {
#endif /* KIOCSRATE */
}
+#undef rate
+
static void
SetKbdRepeat(InputInfoPtr pInfo, char rad)
{