diff options
author | 2003-08-02 13:00:21 +0000 | |
---|---|---|
committer | 2003-08-02 13:00:21 +0000 | |
commit | 1d28e35070061badeb9d38752e705510897d9f1c (patch) | |
tree | e79a67854e270f375c0a326cd048fa64dfb2d41c /sys-apps/kbd/files | |
parent | digest update (diff) | |
download | gentoo-2-1d28e35070061badeb9d38752e705510897d9f1c.tar.gz gentoo-2-1d28e35070061badeb9d38752e705510897d9f1c.tar.bz2 gentoo-2-1d28e35070061badeb9d38752e705510897d9f1c.zip |
A better fix from Keith M Wesolowski <wesolows@gentoo.org> (bug #25517).
Diffstat (limited to 'sys-apps/kbd/files')
-rw-r--r-- | sys-apps/kbd/files/digest-kbd-1.08-r2 | 1 | ||||
-rw-r--r-- | sys-apps/kbd/files/kbd-1.08-kbd_repeat.patch | 157 |
2 files changed, 158 insertions, 0 deletions
diff --git a/sys-apps/kbd/files/digest-kbd-1.08-r2 b/sys-apps/kbd/files/digest-kbd-1.08-r2 new file mode 100644 index 000000000000..9b77d0dd0db3 --- /dev/null +++ b/sys-apps/kbd/files/digest-kbd-1.08-r2 @@ -0,0 +1 @@ +MD5 924e6a05e52715dc0f96385b35f2f680 kbd-1.08.tar.gz 819924 diff --git a/sys-apps/kbd/files/kbd-1.08-kbd_repeat.patch b/sys-apps/kbd/files/kbd-1.08-kbd_repeat.patch new file mode 100644 index 000000000000..7dd9524bcee5 --- /dev/null +++ b/sys-apps/kbd/files/kbd-1.08-kbd_repeat.patch @@ -0,0 +1,157 @@ +diff -urN kbd-1.08.orig/configure kbd-1.08/configure +--- kbd-1.08.orig/configure 2003-08-01 20:31:50.298316445 -0700 ++++ kbd-1.08/configure 2003-08-01 21:00:17.812534740 -0700 +@@ -193,3 +193,33 @@ + else + echo "HAVE_XGETTEXT=no" >> make_include + fi ++ ++# ++# 4. Do we have <linux/kd.h>, and if so what is the name of the second ++# member of struct kbd_repeat? ++# ++echo " ++#include <linux/kd.h> ++main(){ struct kbd_repeat x; x.rate = 0; exit(0); } ++" > conftest.c ++eval $compile ++if test -s conftest && ./conftest 2>/dev/null; then ++ echo "You have <linux/kd.h> (rate)" ++ echo "#define HAVE_kd_h" >> defines.h ++ echo "#define kd_PERIOD rate" >> defines.h ++else ++ echo " ++#include <linux/kd.h> ++main(){ struct kbd_repeat x; x.period = 0; exit(0); } ++" > conftest.c ++ eval $compile ++ if test -s conftest && ./conftest 2>/dev/null; then ++ echo "You have <linux/kd.h> (period)" ++ echo "#define HAVE_kd_h" >> defines.h ++ echo "#define kd_PERIOD period" >> defines.h ++ else ++ echo "You don't have <linux/kd.h>" ++ fi ++fi ++rm -f conftest conftest.c ++ +diff -urN kbd-1.08.orig/src/kbdrate.c kbd-1.08/src/kbdrate.c +--- kbd-1.08.orig/src/kbdrate.c 2003-08-01 20:31:50.443296940 -0700 ++++ kbd-1.08/src/kbdrate.c 2003-08-01 21:02:36.135807454 -0700 +@@ -75,21 +75,15 @@ + #include <sys/file.h> + #include <sys/ioctl.h> + ++#include "../defines.h" ++#ifdef HAVE_kd_h ++#include <linux/kd.h> ++#endif + #ifdef __sparc__ + #include <asm/param.h> + #include <asm/kbio.h> + #endif + +-#ifndef KDKBDREP +-/* usually defined in <linux/kd.h> */ +-#define KDKBDREP 0x4B52 /* set keyboard delay/repeat rate; +- * actually used values are returned */ +-struct kbd_repeat { +- int delay; /* in msec; <= 0: don't change */ +- int period; /* in msec; <= 0: don't change */ +-}; +-#endif +- + #include "nls.h" + #include "version.h" + +@@ -104,12 +98,13 @@ + + static int + KDKBDREP_ioctl_ok(double rate, int delay, int silent) { ++#ifdef KDKBDREP + /* This ioctl is defined in <linux/kd.h> but is not + implemented anywhere - must be in some m68k patches. */ + struct kbd_repeat kbdrep_s; + + /* don't change, just test */ +- kbdrep_s.period = -1; ++ kbdrep_s.kd_PERIOD = -1; + kbdrep_s.delay = -1; + if (ioctl( 0, KDKBDREP, &kbdrep_s )) { + if (errno == EINVAL) +@@ -118,38 +113,37 @@ + exit( 1 ); + } + +-#if 0 +- printf("old delay %d, period %d\n", +- kbdrep_s.delay, kbdrep_s.period); +-#endif +- + /* do the change */ +- if (rate == 0) /* switch repeat off */ +- kbdrep_s.period = 0; ++ if (rate == 0) /* switch repeat off */ ++ kbdrep_s.kd_PERIOD = 0; + else +- kbdrep_s.period = 1000.0 / rate; /* convert cps to msec */ +- if (kbdrep_s.period < 1) +- kbdrep_s.period = 1; ++ kbdrep_s.kd_PERIOD = 1000.0 / rate; /* convert cps to msec */ ++ if (kbdrep_s.kd_PERIOD < 1) ++ kbdrep_s.kd_PERIOD = 1; + kbdrep_s.delay = delay; + if (kbdrep_s.delay < 1) + kbdrep_s.delay = 1; + +- if (ioctl(0, KDKBDREP, &kbdrep_s)) { +- perror("ioctl(KDKBDREP)"); +- exit(1); ++ if (ioctl( 0, KDKBDREP, &kbdrep_s )) { ++ perror( "ioctl(KDKBDREP)" ); ++ exit( 1 ); + } + + /* report */ +- if (kbdrep_s.period == 0) ++ if (kbdrep_s.kd_PERIOD == 0) + rate = 0; + else +- rate = 1000.0 / (double) kbdrep_s.period; ++ rate = 1000.0 / (double) kbdrep_s.kd_PERIOD; + + if (!silent) + printf( _("Typematic Rate set to %.1f cps (delay = %d ms)\n"), + rate, kbdrep_s.delay ); + + return 1; /* success! */ ++ ++#else /* no KDKBDREP */ ++ return 0; ++#endif /* KDKBDREP */ + } + + static int +@@ -164,10 +158,10 @@ + exit( 1 ); + } + +- kbdrate_s.period = (int) (rate + 0.5); /* round up */ ++ kbdrate_s.rate = (int) (rate + 0.5); /* round up */ + kbdrate_s.delay = delay * HZ / 1000; /* convert ms to Hz */ +- if (kbdrate_s.period > 50) +- kbdrate_s.period = 50; ++ if (kbdrate_s.rate > 50) ++ kbdrate_s.rate = 50; + + if (ioctl( fd, KIOCSRATE, &kbdrate_s )) { + perror( "ioctl(KIOCSRATE)" ); +@@ -177,7 +171,7 @@ + + if (!silent) + printf( "Typematic Rate set to %d cps (delay = %d ms)\n", +- kbdrate_s.period, kbdrate_s.delay * 1000 / HZ ); ++ kbdrate_s.rate, kbdrate_s.delay * 1000 / HZ ); + + return 1; + #else /* no KIOCSRATE */ |