diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2013-09-19 17:56:59 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2013-09-19 17:56:59 +0200 |
commit | 054f3eb7848230702b149a7e17f05314cb0157cb (patch) | |
tree | 7a1faa5572b55b4777a58919f6f255b494319021 /console-tools/loadkmap.c | |
parent | a6ed6a31484243e684a51d4cb3114f17f44c3233 (diff) | |
download | busybox-w32-054f3eb7848230702b149a7e17f05314cb0157cb.tar.gz busybox-w32-054f3eb7848230702b149a7e17f05314cb0157cb.tar.bz2 busybox-w32-054f3eb7848230702b149a7e17f05314cb0157cb.zip |
loadkmap: explain what happens with K_ALLOCATED key value
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'console-tools/loadkmap.c')
-rw-r--r-- | console-tools/loadkmap.c | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/console-tools/loadkmap.c b/console-tools/loadkmap.c index bcffe16b1..66ec3b043 100644 --- a/console-tools/loadkmap.c +++ b/console-tools/loadkmap.c | |||
@@ -48,6 +48,7 @@ int loadkmap_main(int argc UNUSED_PARAM, char **argv) | |||
48 | if (argv[1]) | 48 | if (argv[1]) |
49 | bb_show_usage(); | 49 | bb_show_usage(); |
50 | /* bb_warn_ignoring_args(argv[1]); */ | 50 | /* bb_warn_ignoring_args(argv[1]); */ |
51 | |||
51 | fd = get_console_fd_or_die(); | 52 | fd = get_console_fd_or_die(); |
52 | /* or maybe: | 53 | /* or maybe: |
53 | opt = getopt32(argv, "C:", &tty_name); | 54 | opt = getopt32(argv, "C:", &tty_name); |
@@ -61,14 +62,24 @@ int loadkmap_main(int argc UNUSED_PARAM, char **argv) | |||
61 | xread(STDIN_FILENO, flags, MAX_NR_KEYMAPS); | 62 | xread(STDIN_FILENO, flags, MAX_NR_KEYMAPS); |
62 | 63 | ||
63 | for (i = 0; i < MAX_NR_KEYMAPS; i++) { | 64 | for (i = 0; i < MAX_NR_KEYMAPS; i++) { |
64 | if (flags[i] == 1) { | 65 | if (flags[i] != 1) |
65 | xread(STDIN_FILENO, ibuff, NR_KEYS * sizeof(uint16_t)); | 66 | continue; |
66 | for (j = 0; j < NR_KEYS; j++) { | 67 | xread(STDIN_FILENO, ibuff, NR_KEYS * sizeof(uint16_t)); |
67 | ke.kb_index = j; | 68 | for (j = 0; j < NR_KEYS; j++) { |
68 | ke.kb_table = i; | 69 | ke.kb_index = j; |
69 | ke.kb_value = ibuff[j]; | 70 | ke.kb_table = i; |
70 | ioctl(fd, KDSKBENT, &ke); | 71 | ke.kb_value = ibuff[j]; |
71 | } | 72 | /* |
73 | * Note: table[idx:0] can contain special value | ||
74 | * K_ALLOCATED (marks allocated tables in kernel). | ||
75 | * dumpkmap saves the value as-is; but attempts | ||
76 | * to load it here fail, since it isn't a valid | ||
77 | * key value: it is K(KT_SPEC,126) == 2<<8 + 126, | ||
78 | * whereas last valid KT_SPEC is | ||
79 | * K_BARENUMLOCK == K(KT_SPEC,19). | ||
80 | * So far we just ignore these errors: | ||
81 | */ | ||
82 | ioctl(fd, KDSKBENT, &ke); | ||
72 | } | 83 | } |
73 | } | 84 | } |
74 | 85 | ||