aboutsummaryrefslogtreecommitdiff
path: root/console-tools
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2003-03-19 09:13:01 +0000
committerManuel Novoa III <mjn3@codepoet.org>2003-03-19 09:13:01 +0000
commitcad5364599eb5062d59e0c397ed638ddd61a8d5d (patch)
treea318d0f03aa076c74b576ea45dc543a5669e8e91 /console-tools
parente01f9662a5bd5d91be4f6b3941b57fff73cd5af1 (diff)
downloadbusybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.tar.gz
busybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.tar.bz2
busybox-w32-cad5364599eb5062d59e0c397ed638ddd61a8d5d.zip
Major coreutils update.
Diffstat (limited to 'console-tools')
-rw-r--r--console-tools/chvt.c6
-rw-r--r--console-tools/deallocvt.c10
-rw-r--r--console-tools/dumpkmap.c6
-rw-r--r--console-tools/loadacm.c36
-rw-r--r--console-tools/loadfont.c30
-rw-r--r--console-tools/loadkmap.c10
-rw-r--r--console-tools/openvt.c10
-rw-r--r--console-tools/setkeycodes.c8
8 files changed, 58 insertions, 58 deletions
diff --git a/console-tools/chvt.c b/console-tools/chvt.c
index 8136f1c15..11e1078b7 100644
--- a/console-tools/chvt.c
+++ b/console-tools/chvt.c
@@ -23,13 +23,13 @@ int chvt_main(int argc, char **argv)
23 int fd, num; 23 int fd, num;
24 24
25 if ((argc != 2) || (**(argv + 1) == '-')) 25 if ((argc != 2) || (**(argv + 1) == '-'))
26 show_usage(); 26 bb_show_usage();
27 fd = get_console_fd(); 27 fd = get_console_fd();
28 num = atoi(argv[1]); 28 num = atoi(argv[1]);
29 if (ioctl(fd, VT_ACTIVATE, num)) 29 if (ioctl(fd, VT_ACTIVATE, num))
30 perror_msg_and_die("VT_ACTIVATE"); 30 bb_perror_msg_and_die("VT_ACTIVATE");
31 if (ioctl(fd, VT_WAITACTIVE, num)) 31 if (ioctl(fd, VT_WAITACTIVE, num))
32 perror_msg_and_die("VT_WAITACTIVE"); 32 bb_perror_msg_and_die("VT_WAITACTIVE");
33 return EXIT_SUCCESS; 33 return EXIT_SUCCESS;
34} 34}
35 35
diff --git a/console-tools/deallocvt.c b/console-tools/deallocvt.c
index b7dcc9e22..a4ba851c8 100644
--- a/console-tools/deallocvt.c
+++ b/console-tools/deallocvt.c
@@ -19,23 +19,23 @@ int deallocvt_main(int argc, char *argv[])
19 19
20 //if ((argc > 2) || ((argv == 2) && (**(argv + 1) == '-'))) 20 //if ((argc > 2) || ((argv == 2) && (**(argv + 1) == '-')))
21 if (argc > 2) 21 if (argc > 2)
22 show_usage(); 22 bb_show_usage();
23 23
24 fd = get_console_fd(); 24 fd = get_console_fd();
25 25
26 if (argc == 1) { 26 if (argc == 1) {
27 /* deallocate all unused consoles */ 27 /* deallocate all unused consoles */
28 if (ioctl(fd, VT_DISALLOCATE, 0)) 28 if (ioctl(fd, VT_DISALLOCATE, 0))
29 perror_msg_and_die("VT_DISALLOCATE"); 29 bb_perror_msg_and_die("VT_DISALLOCATE");
30 } else { 30 } else {
31 for (i = 1; i < argc; i++) { 31 for (i = 1; i < argc; i++) {
32 num = atoi(argv[i]); 32 num = atoi(argv[i]);
33 if (num == 0) 33 if (num == 0)
34 error_msg("0: illegal VT number"); 34 bb_error_msg("0: illegal VT number");
35 else if (num == 1) 35 else if (num == 1)
36 error_msg("VT 1 cannot be deallocated"); 36 bb_error_msg("VT 1 cannot be deallocated");
37 else if (ioctl(fd, VT_DISALLOCATE, num)) 37 else if (ioctl(fd, VT_DISALLOCATE, num))
38 perror_msg_and_die("VT_DISALLOCATE"); 38 bb_perror_msg_and_die("VT_DISALLOCATE");
39 } 39 }
40 } 40 }
41 41
diff --git a/console-tools/dumpkmap.c b/console-tools/dumpkmap.c
index d2bb6dcff..85926556c 100644
--- a/console-tools/dumpkmap.c
+++ b/console-tools/dumpkmap.c
@@ -48,12 +48,12 @@ int dumpkmap_main(int argc, char **argv)
48 char flags[MAX_NR_KEYMAPS], magic[] = "bkeymap"; 48 char flags[MAX_NR_KEYMAPS], magic[] = "bkeymap";
49 49
50 if (argc>=2 && *argv[1]=='-') { 50 if (argc>=2 && *argv[1]=='-') {
51 show_usage(); 51 bb_show_usage();
52 } 52 }
53 53
54 fd = open(CURRENT_VC, O_RDWR); 54 fd = open(CURRENT_VC, O_RDWR);
55 if (fd < 0) { 55 if (fd < 0) {
56 perror_msg("Error opening " CURRENT_VC); 56 bb_perror_msg("Error opening " CURRENT_VC);
57 return EXIT_FAILURE; 57 return EXIT_FAILURE;
58 } 58 }
59 59
@@ -81,7 +81,7 @@ int dumpkmap_main(int argc, char **argv)
81 ke.kb_table = i; 81 ke.kb_table = i;
82 if (ioctl(fd, KDGKBENT, &ke) < 0) { 82 if (ioctl(fd, KDGKBENT, &ke) < 0) {
83 83
84 error_msg("ioctl returned: %m, %s, %s, %xqq", (char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value); 84 bb_error_msg("ioctl returned: %m, %s, %s, %xqq", (char *)&ke.kb_index,(char *)&ke.kb_table,(int)&ke.kb_value);
85 } 85 }
86 else { 86 else {
87 write(1,(void*)&ke.kb_value,2); 87 write(1,(void*)&ke.kb_value,2);
diff --git a/console-tools/loadacm.c b/console-tools/loadacm.c
index 3fb4e7665..640aa4401 100644
--- a/console-tools/loadacm.c
+++ b/console-tools/loadacm.c
@@ -34,16 +34,16 @@ int loadacm_main(int argc, char **argv)
34 int fd; 34 int fd;
35 35
36 if (argc>=2 && *argv[1]=='-') { 36 if (argc>=2 && *argv[1]=='-') {
37 show_usage(); 37 bb_show_usage();
38 } 38 }
39 39
40 fd = open(CURRENT_VC, O_RDWR); 40 fd = open(CURRENT_VC, O_RDWR);
41 if (fd < 0) { 41 if (fd < 0) {
42 perror_msg_and_die("Error opening " CURRENT_VC); 42 bb_perror_msg_and_die("Error opening " CURRENT_VC);
43 } 43 }
44 44
45 if (screen_map_load(fd, stdin)) { 45 if (screen_map_load(fd, stdin)) {
46 perror_msg_and_die("Error loading acm"); 46 bb_perror_msg_and_die("Error loading acm");
47 } 47 }
48 48
49 write(fd, "\033(K", 3); 49 write(fd, "\033(K", 3);
@@ -60,7 +60,7 @@ static int screen_map_load(int fd, FILE * fp)
60 int is_unicode; 60 int is_unicode;
61 61
62 if (fstat(fileno(fp), &stbuf)) 62 if (fstat(fileno(fp), &stbuf))
63 perror_msg_and_die("Cannot stat map file"); 63 bb_perror_msg_and_die("Cannot stat map file");
64 64
65 /* first try a UTF screen-map: either ASCII (no restriction) or binary (regular file) */ 65 /* first try a UTF screen-map: either ASCII (no restriction) or binary (regular file) */
66 if (! 66 if (!
@@ -70,16 +70,16 @@ static int screen_map_load(int fd, FILE * fp)
70 if (parse_failed) { 70 if (parse_failed) {
71 if (-1 == fseek(fp, 0, SEEK_SET)) { 71 if (-1 == fseek(fp, 0, SEEK_SET)) {
72 if (errno == ESPIPE) 72 if (errno == ESPIPE)
73 error_msg_and_die("16bit screen-map MUST be a regular file."); 73 bb_error_msg_and_die("16bit screen-map MUST be a regular file.");
74 else 74 else
75 perror_msg_and_die("fseek failed reading binary 16bit screen-map"); 75 bb_perror_msg_and_die("fseek failed reading binary 16bit screen-map");
76 } 76 }
77 77
78 if (fread(wbuf, sizeof(unicode) * E_TABSZ, 1, fp) != 1) 78 if (fread(wbuf, sizeof(unicode) * E_TABSZ, 1, fp) != 1)
79 perror_msg_and_die("Cannot read [new] map from file"); 79 bb_perror_msg_and_die("Cannot read [new] map from file");
80#if 0 80#if 0
81 else 81 else
82 error_msg("Input screen-map is binary."); 82 bb_error_msg("Input screen-map is binary.");
83#endif 83#endif
84 } 84 }
85 85
@@ -87,7 +87,7 @@ static int screen_map_load(int fd, FILE * fp)
87 /* same if it was binary, ie. if parse_failed */ 87 /* same if it was binary, ie. if parse_failed */
88 if (parse_failed || is_unicode) { 88 if (parse_failed || is_unicode) {
89 if (ioctl(fd, PIO_UNISCRNMAP, wbuf)) 89 if (ioctl(fd, PIO_UNISCRNMAP, wbuf))
90 perror_msg_and_die("PIO_UNISCRNMAP ioctl"); 90 bb_perror_msg_and_die("PIO_UNISCRNMAP ioctl");
91 else 91 else
92 return 0; 92 return 0;
93 } 93 }
@@ -96,10 +96,10 @@ static int screen_map_load(int fd, FILE * fp)
96 /* rewind... */ 96 /* rewind... */
97 if (-1 == fseek(fp, 0, SEEK_SET)) { 97 if (-1 == fseek(fp, 0, SEEK_SET)) {
98 if (errno == ESPIPE) 98 if (errno == ESPIPE)
99 error_msg("Assuming 8bit screen-map - MUST be a regular file."), 99 bb_error_msg("Assuming 8bit screen-map - MUST be a regular file."),
100 exit(1); 100 exit(1);
101 else 101 else
102 perror_msg_and_die("fseek failed assuming 8bit screen-map"); 102 bb_perror_msg_and_die("fseek failed assuming 8bit screen-map");
103 } 103 }
104 104
105 /* ... and try an old 8-bit screen-map */ 105 /* ... and try an old 8-bit screen-map */
@@ -109,25 +109,25 @@ static int screen_map_load(int fd, FILE * fp)
109 if (-1 == fseek(fp, 0, SEEK_SET)) { 109 if (-1 == fseek(fp, 0, SEEK_SET)) {
110 if (errno == ESPIPE) 110 if (errno == ESPIPE)
111 /* should not - it succedeed above */ 111 /* should not - it succedeed above */
112 error_msg_and_die("fseek() returned ESPIPE !"); 112 bb_error_msg_and_die("fseek() returned ESPIPE !");
113 else 113 else
114 perror_msg_and_die("fseek for binary 8bit screen-map"); 114 bb_perror_msg_and_die("fseek for binary 8bit screen-map");
115 } 115 }
116 116
117 if (fread(buf, E_TABSZ, 1, fp) != 1) 117 if (fread(buf, E_TABSZ, 1, fp) != 1)
118 perror_msg_and_die("Cannot read [old] map from file"); 118 bb_perror_msg_and_die("Cannot read [old] map from file");
119#if 0 119#if 0
120 else 120 else
121 error_msg("Input screen-map is binary."); 121 bb_error_msg("Input screen-map is binary.");
122#endif 122#endif
123 } 123 }
124 124
125 if (ioctl(fd, PIO_SCRNMAP, buf)) 125 if (ioctl(fd, PIO_SCRNMAP, buf))
126 perror_msg_and_die("PIO_SCRNMAP ioctl"); 126 bb_perror_msg_and_die("PIO_SCRNMAP ioctl");
127 else 127 else
128 return 0; 128 return 0;
129 } 129 }
130 error_msg("Error parsing symbolic map"); 130 bb_error_msg("Error parsing symbolic map");
131 return(1); 131 return(1);
132} 132}
133 133
@@ -172,7 +172,7 @@ static int uni_screen_map_read_ascii(FILE * fp, unicode buf[], int *is_unicode)
172 if (feof(fp)) 172 if (feof(fp))
173 break; 173 break;
174 else 174 else
175 perror_msg_and_die("uni_screen_map_read_ascii() can't read line"); 175 bb_perror_msg_and_die("uni_screen_map_read_ascii() can't read line");
176 } 176 }
177 177
178 /* get "charset-relative charcode", stripping leading spaces */ 178 /* get "charset-relative charcode", stripping leading spaces */
diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c
index d66500195..6108151a6 100644
--- a/console-tools/loadfont.c
+++ b/console-tools/loadfont.c
@@ -44,11 +44,11 @@ extern int loadfont_main(int argc, char **argv)
44 int fd; 44 int fd;
45 45
46 if (argc != 1) 46 if (argc != 1)
47 show_usage(); 47 bb_show_usage();
48 48
49 fd = open(CURRENT_VC, O_RDWR); 49 fd = open(CURRENT_VC, O_RDWR);
50 if (fd < 0) 50 if (fd < 0)
51 perror_msg_and_die("Error opening " CURRENT_VC); 51 bb_perror_msg_and_die("Error opening " CURRENT_VC);
52 loadnewfont(fd); 52 loadnewfont(fd);
53 53
54 return EXIT_SUCCESS; 54 return EXIT_SUCCESS;
@@ -62,7 +62,7 @@ static void do_loadfont(int fd, char *inbuf, int unit, int fontsize)
62 memset(buf, 0, sizeof(buf)); 62 memset(buf, 0, sizeof(buf));
63 63
64 if (unit < 1 || unit > 32) 64 if (unit < 1 || unit > 32)
65 error_msg_and_die("Bad character size %d", unit); 65 bb_error_msg_and_die("Bad character size %d", unit);
66 66
67 for (i = 0; i < fontsize; i++) 67 for (i = 0; i < fontsize; i++)
68 memcpy(buf + (32 * i), inbuf + (unit * i), unit); 68 memcpy(buf + (32 * i), inbuf + (unit * i), unit);
@@ -77,11 +77,11 @@ static void do_loadfont(int fd, char *inbuf, int unit, int fontsize)
77 77
78 if (ioctl(fd, PIO_FONTX, &cfd) == 0) 78 if (ioctl(fd, PIO_FONTX, &cfd) == 0)
79 return; /* success */ 79 return; /* success */
80 perror_msg("PIO_FONTX ioctl error (trying PIO_FONT)"); 80 bb_perror_msg("PIO_FONTX ioctl error (trying PIO_FONT)");
81 } 81 }
82#endif 82#endif
83 if (ioctl(fd, PIO_FONT, buf)) 83 if (ioctl(fd, PIO_FONT, buf))
84 perror_msg_and_die("PIO_FONT ioctl error"); 84 bb_perror_msg_and_die("PIO_FONT ioctl error");
85} 85}
86 86
87static void 87static void
@@ -119,11 +119,11 @@ do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
119 if (ioctl(fd, PIO_UNIMAPCLR, &advice)) { 119 if (ioctl(fd, PIO_UNIMAPCLR, &advice)) {
120#ifdef ENOIOCTLCMD 120#ifdef ENOIOCTLCMD
121 if (errno == ENOIOCTLCMD) { 121 if (errno == ENOIOCTLCMD) {
122 error_msg("It seems this kernel is older than 1.1.92"); 122 bb_error_msg("It seems this kernel is older than 1.1.92");
123 error_msg_and_die("No Unicode mapping table loaded."); 123 bb_error_msg_and_die("No Unicode mapping table loaded.");
124 } else 124 } else
125#endif 125#endif
126 perror_msg_and_die("PIO_UNIMAPCLR"); 126 bb_perror_msg_and_die("PIO_UNIMAPCLR");
127 } 127 }
128 ud.entry_ct = ct; 128 ud.entry_ct = ct;
129 ud.entries = up; 129 ud.entries = up;
@@ -133,7 +133,7 @@ do_loadtable(int fd, unsigned char *inbuf, int tailsz, int fontsize)
133 /* change advice parameters */ 133 /* change advice parameters */
134 } 134 }
135#endif 135#endif
136 perror_msg_and_die("PIO_UNIMAP"); 136 bb_perror_msg_and_die("PIO_UNIMAP");
137 } 137 }
138} 138}
139 139
@@ -150,13 +150,13 @@ static void loadnewfont(int fd)
150 */ 150 */
151 inputlth = fread(inbuf, 1, sizeof(inbuf), stdin); 151 inputlth = fread(inbuf, 1, sizeof(inbuf), stdin);
152 if (ferror(stdin)) 152 if (ferror(stdin))
153 perror_msg_and_die("Error reading input font"); 153 bb_perror_msg_and_die("Error reading input font");
154 /* use malloc/realloc in case of giant files; 154 /* use malloc/realloc in case of giant files;
155 maybe these do not occur: 16kB for the font, 155 maybe these do not occur: 16kB for the font,
156 and 16kB for the map leaves 32 unicode values 156 and 16kB for the map leaves 32 unicode values
157 for each font position */ 157 for each font position */
158 if (!feof(stdin)) 158 if (!feof(stdin))
159 perror_msg_and_die("Font too large"); 159 bb_perror_msg_and_die("Font too large");
160 160
161 /* test for psf first */ 161 /* test for psf first */
162 { 162 {
@@ -174,11 +174,11 @@ static void loadnewfont(int fd)
174 goto no_psf; 174 goto no_psf;
175 175
176 if (psfhdr.mode > PSF_MAXMODE) 176 if (psfhdr.mode > PSF_MAXMODE)
177 error_msg_and_die("Unsupported psf file mode"); 177 bb_error_msg_and_die("Unsupported psf file mode");
178 fontsize = ((psfhdr.mode & PSF_MODE512) ? 512 : 256); 178 fontsize = ((psfhdr.mode & PSF_MODE512) ? 512 : 256);
179#if !defined( PIO_FONTX ) || defined( __sparc__ ) 179#if !defined( PIO_FONTX ) || defined( __sparc__ )
180 if (fontsize != 256) 180 if (fontsize != 256)
181 error_msg_and_die("Only fontsize 256 supported"); 181 bb_error_msg_and_die("Only fontsize 256 supported");
182#endif 182#endif
183 hastable = (psfhdr.mode & PSF_MODEHASTAB); 183 hastable = (psfhdr.mode & PSF_MODEHASTAB);
184 unit = psfhdr.charsize; 184 unit = psfhdr.charsize;
@@ -186,7 +186,7 @@ static void loadnewfont(int fd)
186 186
187 head = head0 + fontsize * unit; 187 head = head0 + fontsize * unit;
188 if (head > inputlth || (!hastable && head != inputlth)) 188 if (head > inputlth || (!hastable && head != inputlth))
189 error_msg_and_die("Input file: bad length"); 189 bb_error_msg_and_die("Input file: bad length");
190 do_loadfont(fd, inbuf + head0, unit, fontsize); 190 do_loadfont(fd, inbuf + head0, unit, fontsize);
191 if (hastable) 191 if (hastable)
192 do_loadtable(fd, inbuf + head, inputlth - head, fontsize); 192 do_loadtable(fd, inbuf + head, inputlth - head, fontsize);
@@ -201,7 +201,7 @@ static void loadnewfont(int fd)
201 } else { 201 } else {
202 /* bare font */ 202 /* bare font */
203 if (inputlth & 0377) 203 if (inputlth & 0377)
204 error_msg_and_die("Bad input file size"); 204 bb_error_msg_and_die("Bad input file size");
205 offset = 0; 205 offset = 0;
206 unit = inputlth / 256; 206 unit = inputlth / 256;
207 } 207 }
diff --git a/console-tools/loadkmap.c b/console-tools/loadkmap.c
index 4f217d630..f4208df63 100644
--- a/console-tools/loadkmap.c
+++ b/console-tools/loadkmap.c
@@ -51,18 +51,18 @@ int loadkmap_main(int argc, char **argv)
51 char flags[MAX_NR_KEYMAPS], buff[7]; 51 char flags[MAX_NR_KEYMAPS], buff[7];
52 52
53 if (argc != 1) 53 if (argc != 1)
54 show_usage(); 54 bb_show_usage();
55 55
56 fd = open(CURRENT_VC, O_RDWR); 56 fd = open(CURRENT_VC, O_RDWR);
57 if (fd < 0) 57 if (fd < 0)
58 perror_msg_and_die("Error opening " CURRENT_VC); 58 bb_perror_msg_and_die("Error opening " CURRENT_VC);
59 59
60 read(0, buff, 7); 60 read(0, buff, 7);
61 if (0 != strncmp(buff, BINARY_KEYMAP_MAGIC, 7)) 61 if (0 != strncmp(buff, BINARY_KEYMAP_MAGIC, 7))
62 error_msg_and_die("This is not a valid binary keymap."); 62 bb_error_msg_and_die("This is not a valid binary keymap.");
63 63
64 if (MAX_NR_KEYMAPS != read(0, flags, MAX_NR_KEYMAPS)) 64 if (MAX_NR_KEYMAPS != read(0, flags, MAX_NR_KEYMAPS))
65 perror_msg_and_die("Error reading keymap flags"); 65 bb_perror_msg_and_die("Error reading keymap flags");
66 66
67 ibuff = (u_short *) xmalloc(ibuffsz); 67 ibuff = (u_short *) xmalloc(ibuffsz);
68 68
@@ -71,7 +71,7 @@ int loadkmap_main(int argc, char **argv)
71 pos = 0; 71 pos = 0;
72 while (pos < ibuffsz) { 72 while (pos < ibuffsz) {
73 if ((readsz = read(0, (char *) ibuff + pos, ibuffsz - pos)) < 0) 73 if ((readsz = read(0, (char *) ibuff + pos, ibuffsz - pos)) < 0)
74 perror_msg_and_die("Error reading keymap"); 74 bb_perror_msg_and_die("Error reading keymap");
75 pos += readsz; 75 pos += readsz;
76 } 76 }
77 for (j = 0; j < NR_KEYS; j++) { 77 for (j = 0; j < NR_KEYS; j++) {
diff --git a/console-tools/openvt.c b/console-tools/openvt.c
index 77c897597..519513623 100644
--- a/console-tools/openvt.c
+++ b/console-tools/openvt.c
@@ -43,16 +43,16 @@ int openvt_main(int argc, char **argv)
43 char * cmd_args = NULL; 43 char * cmd_args = NULL;
44 44
45 if (argc < 3) 45 if (argc < 3)
46 show_usage(); 46 bb_show_usage();
47 47
48 if (!isdigit(argv[1][0])) 48 if (!isdigit(argv[1][0]))
49 show_usage(); 49 bb_show_usage();
50 50
51 vtno = (int) atol(argv[1]); 51 vtno = (int) atol(argv[1]);
52 52
53 /* if (vtno <= 0 || vtno > 63) */ 53 /* if (vtno <= 0 || vtno > 63) */
54 if (vtno <= 0 || vtno > 12) 54 if (vtno <= 0 || vtno > 12)
55 error_msg_and_die("Illegal vt number (%d)", vtno); 55 bb_error_msg_and_die("Illegal vt number (%d)", vtno);
56 56
57 sprintf(vtname, VTNAME, vtno); 57 sprintf(vtname, VTNAME, vtno);
58 58
@@ -69,13 +69,13 @@ int openvt_main(int argc, char **argv)
69 if (setsid() < 0) { 69 if (setsid() < 0) {
70#endif 70#endif
71 71
72 perror_msg_and_die("Unable to set new session"); 72 bb_perror_msg_and_die("Unable to set new session");
73 } 73 }
74 close(0); /* so that new vt becomes stdin */ 74 close(0); /* so that new vt becomes stdin */
75 75
76 /* and grab new one */ 76 /* and grab new one */
77 if ((fd = open(vtname, O_RDWR)) == -1) 77 if ((fd = open(vtname, O_RDWR)) == -1)
78 perror_msg_and_die("could not open %s", vtname); 78 bb_perror_msg_and_die("could not open %s", vtname);
79 79
80 /* Reassign stdout and sterr */ 80 /* Reassign stdout and sterr */
81 close(1); 81 close(1);
diff --git a/console-tools/setkeycodes.c b/console-tools/setkeycodes.c
index 85612c8b1..796bab285 100644
--- a/console-tools/setkeycodes.c
+++ b/console-tools/setkeycodes.c
@@ -43,7 +43,7 @@ setkeycodes_main(int argc, char** argv)
43 struct kbkeycode a; 43 struct kbkeycode a;
44 44
45 if (argc % 2 != 1 || argc < 2) { 45 if (argc % 2 != 1 || argc < 2) {
46 show_usage(); 46 bb_show_usage();
47 } 47 }
48 48
49 fd = get_console_fd(); 49 fd = get_console_fd();
@@ -52,18 +52,18 @@ setkeycodes_main(int argc, char** argv)
52 a.keycode = atoi(argv[2]); 52 a.keycode = atoi(argv[2]);
53 a.scancode = sc = strtol(argv[1], &ep, 16); 53 a.scancode = sc = strtol(argv[1], &ep, 16);
54 if (*ep) { 54 if (*ep) {
55 error_msg_and_die("error reading SCANCODE: '%s'", argv[1]); 55 bb_error_msg_and_die("error reading SCANCODE: '%s'", argv[1]);
56 } 56 }
57 if (a.scancode > 127) { 57 if (a.scancode > 127) {
58 a.scancode -= 0xe000; 58 a.scancode -= 0xe000;
59 a.scancode += 128; 59 a.scancode += 128;
60 } 60 }
61 if (a.scancode > 255 || a.keycode > 127) { 61 if (a.scancode > 255 || a.keycode > 127) {
62 error_msg_and_die("SCANCODE or KEYCODE outside bounds"); 62 bb_error_msg_and_die("SCANCODE or KEYCODE outside bounds");
63 } 63 }
64 if (ioctl(fd,KDSETKEYCODE,&a)) { 64 if (ioctl(fd,KDSETKEYCODE,&a)) {
65 perror("KDSETKEYCODE"); 65 perror("KDSETKEYCODE");
66 error_msg_and_die("failed to set SCANCODE %x to KEYCODE %d", sc, a.keycode); 66 bb_error_msg_and_die("failed to set SCANCODE %x to KEYCODE %d", sc, a.keycode);
67 } 67 }
68 argc -= 2; 68 argc -= 2;
69 argv += 2; 69 argv += 2;