Undo rate/period change after function body, so the damage doesn't leak

into other functions. (Debian #050)
This commit is contained in:
Daniel Stone 2005-08-26 07:24:21 +00:00
parent bb5e934df7
commit 89c84575ea
2 changed files with 22 additions and 2 deletions

View File

@ -77,7 +77,9 @@ xf86GetKbdLeds()
#include <asm/kbio.h> #include <asm/kbio.h>
#endif #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 defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42) # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
# define rate period # define rate period
@ -120,6 +122,13 @@ KDKBDREP_ioctl_ok(int rate, int delay) {
#undef rate #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 static int
KIOCSRATE_ioctl_ok(int rate, int delay) { KIOCSRATE_ioctl_ok(int rate, int delay) {
#ifdef KIOCSRATE #ifdef KIOCSRATE

View File

@ -107,7 +107,9 @@ GetKbdLeds(InputInfoPtr pInfo)
#include <asm/kbio.h> #include <asm/kbio.h>
#endif #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 defined(LINUX_VERSION_CODE) && defined(KERNEL_VERSION)
# if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42) # if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,42)
# define rate period # define rate period
@ -151,6 +153,13 @@ KDKBDREP_ioctl_ok(int rate, int delay) {
#undef rate #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 static int
KIOCSRATE_ioctl_ok(int rate, int delay) { KIOCSRATE_ioctl_ok(int rate, int delay) {
#ifdef KIOCSRATE #ifdef KIOCSRATE
@ -178,6 +187,8 @@ KIOCSRATE_ioctl_ok(int rate, int delay) {
#endif /* KIOCSRATE */ #endif /* KIOCSRATE */
} }
#undef rate
static void static void
SetKbdRepeat(InputInfoPtr pInfo, char rad) SetKbdRepeat(InputInfoPtr pInfo, char rad)
{ {