summaryrefslogtreecommitdiff
path: root/console-tools/loadkmap.c
diff options
context:
space:
mode:
authorDenys Vlasenko2010-06-06 18:09:57 +0200
committerDenys Vlasenko2010-06-06 18:09:57 +0200
commit2fd45c2cdbf51dbafe1f44a49421a45a1cee4907 (patch)
treec8db99482dec94e9defd339872d857272398bf84 /console-tools/loadkmap.c
parentf2da16f451812f40bed51fd60a304df3d7dfc1bd (diff)
downloadbusybox-2fd45c2cdbf51dbafe1f44a49421a45a1cee4907.zip
busybox-2fd45c2cdbf51dbafe1f44a49421a45a1cee4907.tar.gz
dumpkmap,loadkmap: abort if there are params on cmdline
function old new delta loadkmap_main 201 219 +18 dumpkmap_main 208 223 +15 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'console-tools/loadkmap.c')
-rw-r--r--console-tools/loadkmap.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/console-tools/loadkmap.c b/console-tools/loadkmap.c
index 912291a..9e2c779 100644
--- a/console-tools/loadkmap.c
+++ b/console-tools/loadkmap.c
@@ -32,6 +32,11 @@ int loadkmap_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
/* const char *tty_name = CURRENT_TTY; */
RESERVE_CONFIG_BUFFER(flags, MAX_NR_KEYMAPS);
+ /* When user accidentally runs "loadkmap FILE"
+ * instead of "loadkmap <FILE", we end up waiting for input from tty.
+ * Let's prevent it: */
+ if (argv[1])
+ bb_show_usage();
/* bb_warn_ignoring_args(argv[1]); */
fd = get_console_fd_or_die();
/* or maybe: