X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=console-tools%2Fdumpkmap.c;h=40b58f716eb497a9fca4bce68daef10a2400c518;hb=482f2b31e788fdd849f78a3aa91cf6102fc98892;hp=0c1914830892658465912870c135c499add21c8b;hpb=06af2165288cd6516b89001ec9e24992619230e0;p=oweals%2Fbusybox.git diff --git a/console-tools/dumpkmap.c b/console-tools/dumpkmap.c index 0c1914830..40b58f716 100644 --- a/console-tools/dumpkmap.c +++ b/console-tools/dumpkmap.c @@ -8,7 +8,7 @@ * */ -#include "busybox.h" +#include "libbb.h" /* From */ struct kbentry { @@ -22,7 +22,7 @@ struct kbentry { #define NR_KEYS 128 #define MAX_NR_KEYMAPS 256 -int dumpkmap_main(int argc, char **argv); +int dumpkmap_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; int dumpkmap_main(int argc, char **argv) { struct kbentry ke; @@ -50,12 +50,12 @@ int dumpkmap_main(int argc, char **argv) for (j = 0; j < NR_KEYS; j++) { ke.kb_index = j; ke.kb_table = i; - if (ioctl(fd, KDGKBENT, &ke) < 0) { - bb_perror_msg("ioctl failed with %s, %s, %p", + if (!ioctl_or_perror(fd, KDGKBENT, &ke, + "ioctl failed with %s, %s, %p", (char *)&ke.kb_index, (char *)&ke.kb_table, - &ke.kb_value); - } else { + &ke.kb_value) + ) { write(1, (void*)&ke.kb_value, 2); } }