aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NOFORK_NOEXEC.lst2
-rw-r--r--console-tools/setkeycodes.c15
2 files changed, 9 insertions, 8 deletions
diff --git a/NOFORK_NOEXEC.lst b/NOFORK_NOEXEC.lst
index 8145e2597..58b3e9c54 100644
--- a/NOFORK_NOEXEC.lst
+++ b/NOFORK_NOEXEC.lst
@@ -307,7 +307,7 @@ seq - noexec. runner
307setarch - noexec. spawner 307setarch - noexec. spawner
308setconsole 308setconsole
309setfont 309setfont
310setkeycodes 310setkeycodes - noexec
311setlogcons - noexec 311setlogcons - noexec
312setpriv - spawner, changes state, let's play safe and not be noexec 312setpriv - spawner, changes state, let's play safe and not be noexec
313setserial - noexec 313setserial - noexec
diff --git a/console-tools/setkeycodes.c b/console-tools/setkeycodes.c
index 543fbe3e0..1363ac9d1 100644
--- a/console-tools/setkeycodes.c
+++ b/console-tools/setkeycodes.c
@@ -16,17 +16,16 @@
16//config: This program loads entries into the kernel's scancode-to-keycode 16//config: This program loads entries into the kernel's scancode-to-keycode
17//config: map, allowing unusual keyboards to generate usable keycodes. 17//config: map, allowing unusual keyboards to generate usable keycodes.
18 18
19//applet:IF_SETKEYCODES(APPLET(setkeycodes, BB_DIR_USR_BIN, BB_SUID_DROP)) 19//applet:IF_SETKEYCODES(APPLET_NOEXEC(setkeycodes, setkeycodes, BB_DIR_USR_BIN, BB_SUID_DROP, setkeycodes))
20 20
21//kbuild:lib-$(CONFIG_SETKEYCODES) += setkeycodes.o 21//kbuild:lib-$(CONFIG_SETKEYCODES) += setkeycodes.o
22 22
23//usage:#define setkeycodes_trivial_usage 23//usage:#define setkeycodes_trivial_usage
24//usage: "SCANCODE KEYCODE..." 24//usage: "{ SCANCODE KEYCODE }..."
25//usage:#define setkeycodes_full_usage "\n\n" 25//usage:#define setkeycodes_full_usage "\n\n"
26//usage: "Set entries into the kernel's scancode-to-keycode map,\n" 26//usage: "Modify kernel's scancode-to-keycode map,\n"
27//usage: "allowing unusual keyboards to generate usable keycodes.\n\n" 27//usage: "allowing unusual keyboards to generate usable keycodes.\n\n"
28//usage: "SCANCODE may be either xx or e0xx (hexadecimal),\n" 28//usage: "SCANCODE is either xx or e0xx (hexadecimal), KEYCODE is decimal."
29//usage: "and KEYCODE is given in decimal."
30//usage: 29//usage:
31//usage:#define setkeycodes_example_usage 30//usage:#define setkeycodes_example_usage
32//usage: "$ setkeycodes e030 127\n" 31//usage: "$ setkeycodes e030 127\n"
@@ -45,7 +44,6 @@ int setkeycodes_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE;
45int setkeycodes_main(int argc, char **argv) 44int setkeycodes_main(int argc, char **argv)
46{ 45{
47 int fd; 46 int fd;
48 struct kbkeycode a;
49 47
50 if (!(argc & 1) /* if even */ || argc < 2) { 48 if (!(argc & 1) /* if even */ || argc < 2) {
51 bb_show_usage(); 49 bb_show_usage();
@@ -54,7 +52,10 @@ int setkeycodes_main(int argc, char **argv)
54 fd = get_console_fd_or_die(); 52 fd = get_console_fd_or_die();
55 53
56 while (argv[1]) { 54 while (argv[1]) {
57 int sc = xstrtoul_range(argv[1], 16, 0, 0xe07f); 55 struct kbkeycode a;
56 int sc;
57
58 sc = xstrtoul_range(argv[1], 16, 0, 0xe07f);
58 if (sc >= 0xe000) { 59 if (sc >= 0xe000) {
59 sc -= 0xe000; 60 sc -= 0xe000;
60 sc += 0x0080; 61 sc += 0x0080;