--- kbd-1.15.3/src/dumpkeys.c 2011-04-26 20:29:35.000000000 +0000 +++ kbd-1.15.3.patched/src/dumpkeys.c 2012-11-02 20:55:42.405000003 +0000 @@ -107,7 +107,7 @@ } static int -get_bind(u_char kb_index, u_char kb_table) { +get_bind(unsigned char kb_index, unsigned char kb_table) { struct kbentry ke; ke.kb_index = kb_index; @@ -169,7 +169,7 @@ return status; } -static u_char +static unsigned char maximum_val(int t) { struct kbentry ke, ke0; int i; @@ -440,7 +440,7 @@ (val >= 'a' && val <= 'z'))); isasexpected = 0; if (isletter) { - u_short defs[16]; + unsigned short defs[16]; defs[0] = K(KT_LETTER, val); defs[1] = K(KT_LETTER, val ^ 32); defs[2] = defs[0]; diff -ur kbd-1.15.3/src/kbdinfo.c kbd-1.15.3.patched/src/kbdinfo.c --- kbd-1.15.3/src/kbdinfo.c 2011-04-26 20:29:35.000000000 +0000 +++ kbd-1.15.3.patched/src/kbdinfo.c 2012-11-02 21:22:31.081000003 +0000 @@ -1,6 +1,5 @@ #include #include -#include #include #include #include @@ -8,10 +7,12 @@ #include "getfd.h" #include "nls.h" #include "version.h" +#include "error.c" static const char *action = NULL; static const char *value = NULL; + static void attr_noreturn usage(int code) { fprintf(stderr, diff -ur kbd-1.15.3/src/kbdrate.c kbd-1.15.3.patched/src/kbdrate.c --- kbd-1.15.3/src/kbdrate.c 2011-03-05 14:41:20.000000000 +0000 +++ kbd-1.15.3.patched/src/kbdrate.c 2012-11-02 20:57:25.869000003 +0000 @@ -74,6 +74,7 @@ #include #include #include +#include #ifdef __sparc__ #include diff -ur kbd-1.15.3/src/loadkeys.c kbd-1.15.3.patched/src/loadkeys.c --- kbd-1.15.3/src/loadkeys.c 2011-05-01 23:22:35.000000000 +0000 +++ kbd-1.15.3.patched/src/loadkeys.c 2012-11-02 20:55:48.743000003 +0000 @@ -114,7 +114,7 @@ int alt_is_meta = 0; /* the kernel structures we want to set or print */ -u_short *key_map[MAX_NR_KEYMAPS]; +unsigned short *key_map[MAX_NR_KEYMAPS]; char *func_table[MAX_NR_FUNC]; accent_entry accent_table[MAX_DIACR]; @@ -255,7 +255,7 @@ if (!key_map[k_table]) { key_map[k_table] = - (u_short *) xmalloc(NR_KEYS * sizeof(u_short)); + (unsigned short *) xmalloc(NR_KEYS * sizeof(unsigned short)); for (i = 0; i < NR_KEYS; i++) (key_map[k_table])[i] = K_HOLE; } @@ -566,7 +566,7 @@ return kd.kb_cnt; } -static void do_constant_key(int i, u_short key) +static void do_constant_key(int i, unsigned short key) { int typ, val, j; @@ -575,7 +575,7 @@ if ((typ == KT_LATIN || typ == KT_LETTER) && ((val >= 'a' && val <= 'z') || (val >= 'A' && val <= 'Z'))) { - u_short defs[16]; + unsigned short defs[16]; defs[0] = K(KT_LETTER, val); defs[1] = K(KT_LETTER, val ^ 32); defs[2] = defs[0]; @@ -620,7 +620,7 @@ for (i = 0; i < NR_KEYS; i++) { if (key_is_constant[i]) { - u_short key; + unsigned short key; if (!key_map[r0]) lkfatal(_("impossible error in do_constant")); @@ -800,7 +800,7 @@ keymap_count++; if (i) printf("static "); - printf("u_short %s_map[NR_KEYS] = {", mk_mapname(i)); + printf("unsigned short %s_map[NR_KEYS] = {", mk_mapname(i)); for (j = 0; j < NR_KEYS; j++) { if (!(j % 8)) printf("\n"); @@ -904,7 +904,7 @@ { int i, j; - //u_char *p; + //unsigned char *p; char flag, magic[] = "bkeymap"; unsigned short v; diff -ur kbd-1.15.3/src/loadkeys.y kbd-1.15.3.patched/src/loadkeys.y --- kbd-1.15.3/src/loadkeys.y 2011-05-01 23:19:11.000000000 +0000 +++ kbd-1.15.3.patched/src/loadkeys.y 2012-11-02 20:55:42.410000003 +0000 @@ -55,7 +55,7 @@ int alt_is_meta = 0; /* the kernel structures we want to set or print */ -u_short *key_map[MAX_NR_KEYMAPS]; +unsigned short *key_map[MAX_NR_KEYMAPS]; char *func_table[MAX_NR_FUNC]; accent_entry accent_table[MAX_DIACR]; @@ -196,7 +196,7 @@ if (!key_map[k_table]) { key_map[k_table] = - (u_short *) xmalloc(NR_KEYS * sizeof(u_short)); + (unsigned short *) xmalloc(NR_KEYS * sizeof(unsigned short)); for (i = 0; i < NR_KEYS; i++) (key_map[k_table])[i] = K_HOLE; } @@ -507,7 +507,7 @@ return kd.kb_cnt; } -static void do_constant_key(int i, u_short key) +static void do_constant_key(int i, unsigned short key) { int typ, val, j; @@ -516,7 +516,7 @@ if ((typ == KT_LATIN || typ == KT_LETTER) && ((val >= 'a' && val <= 'z') || (val >= 'A' && val <= 'Z'))) { - u_short defs[16]; + unsigned short defs[16]; defs[0] = K(KT_LETTER, val); defs[1] = K(KT_LETTER, val ^ 32); defs[2] = defs[0]; @@ -561,7 +561,7 @@ for (i = 0; i < NR_KEYS; i++) { if (key_is_constant[i]) { - u_short key; + unsigned short key; if (!key_map[r0]) lkfatal(_("impossible error in do_constant")); @@ -741,7 +741,7 @@ keymap_count++; if (i) printf("static "); - printf("u_short %s_map[NR_KEYS] = {", mk_mapname(i)); + printf("unsigned short %s_map[NR_KEYS] = {", mk_mapname(i)); for (j = 0; j < NR_KEYS; j++) { if (!(j % 8)) printf("\n"); @@ -845,7 +845,7 @@ { int i, j; - //u_char *p; + //unsigned char *p; char flag, magic[] = "bkeymap"; unsigned short v; diff -ur kbd-1.15.3/src/openvt.c kbd-1.15.3.patched/src/openvt.c --- kbd-1.15.3/src/openvt.c 2011-05-01 23:27:13.000000000 +0000 +++ kbd-1.15.3.patched/src/openvt.c 2012-11-02 20:59:45.516000002 +0000 @@ -10,7 +10,7 @@ #include #include #include - +#include #include "version.h" #include "xmalloc.h" #include "getfd.h" diff -ur kbd-1.15.3/src/setvtrgb.c kbd-1.15.3.patched/src/setvtrgb.c --- kbd-1.15.3/src/setvtrgb.c 2011-04-26 20:29:35.000000000 +0000 +++ kbd-1.15.3.patched/src/setvtrgb.c 2012-11-02 21:22:50.566000002 +0000 @@ -5,7 +5,7 @@ #include #include #include -#include +#include "error.c" #include "kbd.h" #include "getfd.h" #include "nls.h" --- /dev/null 2012-10-16 17:31:41.304000002 +0000 +++ kbd-1.15.3.patched/src/error.c 2012-11-02 21:22:07.812000002 +0000 @@ -0,0 +1,24 @@ +#include +#include + +static void error(int status, int errnum, const char *fmt, ...) { + fflush(stdout); + char dest[4096]; + va_list ap; + va_start(ap, fmt); + ssize_t result = vsnprintf(dest, sizeof(dest), fmt, ap); + va_end(ap); + dprintf(2, "program_name: %s", dest); + if(errnum) { + dprintf(2, ": "); + perror(fmt); + exit (status); + } else { + dprintf(2, "\n"); + } +} + + + + +