projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
gz_open and gz_close were left in, even when BB_FEATURE_TAR_GZIP was disabled.
[oweals/busybox.git]
/
loadkmap.c
diff --git
a/loadkmap.c
b/loadkmap.c
index fc2439864454b778a06403a40b8ee621e851d2f5..dcb5c1caa1ef2e4b6b3772018df441d1fe948fbb 100644
(file)
--- a/
loadkmap.c
+++ b/
loadkmap.c
@@
-20,11
+20,14
@@
*
*/
*
*/
-#include "busybox.h"
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <unistd.h>
#include <sys/ioctl.h>
#include <sys/ioctl.h>
+#include "busybox.h"
#define BINARY_KEYMAP_MAGIC "bkeymap"
#define BINARY_KEYMAP_MAGIC "bkeymap"
@@
-34,11
+37,11
@@
struct kbentry {
unsigned char kb_index;
unsigned short kb_value;
};
unsigned char kb_index;
unsigned short kb_value;
};
-
#define KDSKBENT 0x4B47
/* sets one entry in translation table */
+
static const int KDSKBENT = 0x4B47;
/* sets one entry in translation table */
/* From <linux/keyboard.h> */
/* From <linux/keyboard.h> */
-#define NR_KEYS 128
-#define MAX_NR_KEYMAPS 256
+static const int NR_KEYS = 128;
+static const int MAX_NR_KEYMAPS = 256;
int loadkmap_main(int argc, char **argv)
{
int loadkmap_main(int argc, char **argv)
{
@@
-48,7
+51,7
@@
int loadkmap_main(int argc, char **argv)
char flags[MAX_NR_KEYMAPS], buff[7];
if (argc != 1)
char flags[MAX_NR_KEYMAPS], buff[7];
if (argc != 1)
-
usage(loadkmap_usage
);
+
show_usage(
);
fd = open("/dev/tty0", O_RDWR);
if (fd < 0)
fd = open("/dev/tty0", O_RDWR);
if (fd < 0)
@@
-56,7
+59,7
@@
int loadkmap_main(int argc, char **argv)
read(0, buff, 7);
if (0 != strncmp(buff, BINARY_KEYMAP_MAGIC, 7))
read(0, buff, 7);
if (0 != strncmp(buff, BINARY_KEYMAP_MAGIC, 7))
- error_msg_and_die("This is not a valid binary keymap.
\n
");
+ error_msg_and_die("This is not a valid binary keymap.");
if (MAX_NR_KEYMAPS != read(0, flags, MAX_NR_KEYMAPS))
perror_msg_and_die("Error reading keymap flags");
if (MAX_NR_KEYMAPS != read(0, flags, MAX_NR_KEYMAPS))
perror_msg_and_die("Error reading keymap flags");