From 44e2d9167943182fea530dfd7ec16aa53db20f4c Mon Sep 17 00:00:00 2001 From: Roland Mainz Date: Wed, 2 Feb 2005 00:55:21 +0000 Subject: [PATCH] xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Sbus.h xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_io.c //bugs.freedesktop.org/show_bug.cgi?id=825) attachment #956 (https://bugs.freedesktop.org/attachment.cgi?id=956): Fix build problems on Linux/SPARC. Patch by Jeremy Huddleston . Approved in the 2005-01-31 Xorg release-wranglers phone call. --- hw/xfree86/os-support/bus/xf86Sbus.h | 9 ++++++++- hw/xfree86/os-support/linux/lnx_io.c | 20 +++++++------------- hw/xfree86/os-support/linux/lnx_kbd.c | 4 ++-- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/hw/xfree86/os-support/bus/xf86Sbus.h b/hw/xfree86/os-support/bus/xf86Sbus.h index 5c8acfd4b..1ff4432b4 100644 --- a/hw/xfree86/os-support/bus/xf86Sbus.h +++ b/hw/xfree86/os-support/bus/xf86Sbus.h @@ -20,13 +20,14 @@ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Sbus.h,v 1.5 2002/05/22 21:38:30 herrb Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Sbus.h,v 1.3 2001/04/20 17:02:43 tsi Exp $ */ #ifndef _XF86_SBUS_H #define _XF86_SBUS_H #if defined(linux) #include +#include #include #include #elif defined(SVR4) @@ -35,7 +36,13 @@ #elif defined(__OpenBSD__) && defined(__sparc64__) /* XXX */ #elif defined(CSRG_BASED) +#if defined(__FreeBSD__) +#include +#include +#include +#else #include +#endif #else #include #endif diff --git a/hw/xfree86/os-support/linux/lnx_io.c b/hw/xfree86/os-support/linux/lnx_io.c index 303c6e3d3..1eebc757a 100644 --- a/hw/xfree86/os-support/linux/lnx_io.c +++ b/hw/xfree86/os-support/linux/lnx_io.c @@ -90,10 +90,9 @@ KDKBDREP_ioctl_ok(int rate, int delay) { /* don't change, just test */ kbdrep_s.rate = -1; kbdrep_s.delay = -1; - if (ioctl( 0, KDKBDREP, &kbdrep_s )) { + if (ioctl( xf86Info.consoleFd, KDKBDREP, &kbdrep_s )) { return 0; } - /* do the change */ if (rate == 0) /* switch repeat off */ kbdrep_s.rate = 0; @@ -105,7 +104,7 @@ KDKBDREP_ioctl_ok(int rate, int delay) { if (kbdrep_s.delay < 1) kbdrep_s.delay = 1; - if (ioctl( 0, KDKBDREP, &kbdrep_s )) { + if (ioctl( xf86Info.consoleFd, KDKBDREP, &kbdrep_s )) { return 0; } @@ -115,6 +114,8 @@ KDKBDREP_ioctl_ok(int rate, int delay) { #endif /* KDKBDREP */ } +#undef rate + static int KIOCSRATE_ioctl_ok(int rate, int delay) { #ifdef KIOCSRATE @@ -130,8 +131,9 @@ KIOCSRATE_ioctl_ok(int rate, int delay) { if (kbdrate_s.rate > 50) kbdrate_s.rate = 50; - if (ioctl( fd, KIOCSRATE, &kbdrate_s )) - return 0; + if (ioctl( fd, KIOCSRATE, &kbdrate_s )) { + return 0; + } close( fd ); @@ -141,14 +143,7 @@ KIOCSRATE_ioctl_ok(int rate, int delay) { #endif /* KIOCSRATE */ } -#undef rate - -#if NeedFunctionPrototypes void xf86SetKbdRepeat(char rad) -#else -void xf86SetKbdRepeat(rad) -char rad; -#endif { #ifdef __sparc__ int rate = 500; /* Default rate */ @@ -178,7 +173,6 @@ char rad; if (xf86Info.kbdDelay >= 0) delay = xf86Info.kbdDelay; - if(KDKBDREP_ioctl_ok(rate, delay)) /* m68k? */ return; diff --git a/hw/xfree86/os-support/linux/lnx_kbd.c b/hw/xfree86/os-support/linux/lnx_kbd.c index 48a62e215..18eff7fe6 100644 --- a/hw/xfree86/os-support/linux/lnx_kbd.c +++ b/hw/xfree86/os-support/linux/lnx_kbd.c @@ -145,6 +145,8 @@ KDKBDREP_ioctl_ok(int rate, int delay) { #endif /* KDKBDREP */ } +#undef rate + static int KIOCSRATE_ioctl_ok(int rate, int delay) { #ifdef KIOCSRATE @@ -172,8 +174,6 @@ KIOCSRATE_ioctl_ok(int rate, int delay) { #endif /* KIOCSRATE */ } -#undef rate - static void SetKbdRepeat(InputInfoPtr pInfo, char rad) {