*
*/
-#include "busybox.h"
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
#include <sys/ioctl.h>
+#include "busybox.h"
/* From <linux/kd.h> */
struct kbentry {
char flags[MAX_NR_KEYMAPS], magic[] = "bkeymap";
if (argc>=2 && *argv[1]=='-') {
- usage(dumpkmap_usage);
+ show_usage();
}
- fd = open("/dev/tty0", O_RDWR);
+ fd = open(CURRENT_VC, O_RDWR);
if (fd < 0) {
- perror_msg("Error opening /dev/tty0");
+ perror_msg("Error opening " CURRENT_VC);
return EXIT_FAILURE;
}
ke.kb_table = i;
if (ioctl(fd, KDGKBENT, &ke) < 0) {
- error_msg("ioctl returned: %s, %s, %s, %xqq\n",strerror(errno),(char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value);
+ error_msg("ioctl returned: %s, %s, %s, %xqq", strerror(errno),(char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value);
}
else {
write(1,(void*)&ke.kb_value,2);