aboutsummaryrefslogtreecommitdiff
path: root/console-tools
diff options
context:
space:
mode:
Diffstat (limited to 'console-tools')
-rw-r--r--console-tools/dumpkmap.c9
-rw-r--r--console-tools/loadfont.c14
-rw-r--r--console-tools/loadkmap.c9
-rw-r--r--console-tools/openvt.c2
-rw-r--r--console-tools/setconsole.c9
-rw-r--r--console-tools/setlogcons.c6
6 files changed, 7 insertions, 42 deletions
diff --git a/console-tools/dumpkmap.c b/console-tools/dumpkmap.c
index 62313e77f..7c6633ae8 100644
--- a/console-tools/dumpkmap.c
+++ b/console-tools/dumpkmap.c
@@ -8,13 +8,6 @@
8 * 8 *
9 */ 9 */
10 10
11#include <errno.h>
12#include <fcntl.h>
13#include <stdio.h>
14#include <unistd.h>
15#include <string.h>
16#include <stdlib.h>
17#include <sys/ioctl.h>
18#include "busybox.h" 11#include "busybox.h"
19 12
20/* From <linux/kd.h> */ 13/* From <linux/kd.h> */
@@ -38,7 +31,7 @@ int dumpkmap_main(int argc, char **argv)
38 if (argc >= 2 && *argv[1] == '-') 31 if (argc >= 2 && *argv[1] == '-')
39 bb_show_usage(); 32 bb_show_usage();
40 33
41 fd = bb_xopen(CURRENT_VC, O_RDWR); 34 fd = xopen(CURRENT_VC, O_RDWR);
42 35
43 write(1, magic, 7); 36 write(1, magic, 7);
44 37
diff --git a/console-tools/loadfont.c b/console-tools/loadfont.c
index 2421cadcf..3d8588565 100644
--- a/console-tools/loadfont.c
+++ b/console-tools/loadfont.c
@@ -7,18 +7,8 @@
7 * Loads the console font, and possibly the corresponding screen map(s). 7 * Loads the console font, and possibly the corresponding screen map(s).
8 * (Adapted for busybox by Matej Vela.) 8 * (Adapted for busybox by Matej Vela.)
9 */ 9 */
10#include <stdio.h>
11#include <string.h>
12#include <fcntl.h>
13#include <stdlib.h>
14#include <unistd.h>
15#include <sys/types.h>
16#include <dirent.h>
17#include <errno.h>
18#include <sys/ioctl.h>
19#include <sys/kd.h>
20#include <endian.h>
21#include "busybox.h" 10#include "busybox.h"
11#include <sys/kd.h>
22 12
23enum{ 13enum{
24 PSF_MAGIC1 = 0x36, 14 PSF_MAGIC1 = 0x36,
@@ -47,7 +37,7 @@ int loadfont_main(int argc, char **argv)
47 if (argc != 1) 37 if (argc != 1)
48 bb_show_usage(); 38 bb_show_usage();
49 39
50 fd = bb_xopen(CURRENT_VC, O_RDWR); 40 fd = xopen(CURRENT_VC, O_RDWR);
51 loadnewfont(fd); 41 loadnewfont(fd);
52 42
53 return EXIT_SUCCESS; 43 return EXIT_SUCCESS;
diff --git a/console-tools/loadkmap.c b/console-tools/loadkmap.c
index 69d33bd95..ec55c3990 100644
--- a/console-tools/loadkmap.c
+++ b/console-tools/loadkmap.c
@@ -8,13 +8,6 @@
8 * 8 *
9 */ 9 */
10 10
11#include <errno.h>
12#include <fcntl.h>
13#include <stdio.h>
14#include <string.h>
15#include <stdlib.h>
16#include <unistd.h>
17#include <sys/ioctl.h>
18#include "busybox.h" 11#include "busybox.h"
19 12
20#define BINARY_KEYMAP_MAGIC "bkeymap" 13#define BINARY_KEYMAP_MAGIC "bkeymap"
@@ -43,7 +36,7 @@ int loadkmap_main(int argc, char **argv)
43 if (argc != 1) 36 if (argc != 1)
44 bb_show_usage(); 37 bb_show_usage();
45 38
46 fd = bb_xopen(CURRENT_VC, O_RDWR); 39 fd = xopen(CURRENT_VC, O_RDWR);
47 40
48 xread(0, buff, 7); 41 xread(0, buff, 7);
49 if (strncmp(buff, BINARY_KEYMAP_MAGIC, 7)) 42 if (strncmp(buff, BINARY_KEYMAP_MAGIC, 7))
diff --git a/console-tools/openvt.c b/console-tools/openvt.c
index 948dba767..0c0cef23c 100644
--- a/console-tools/openvt.c
+++ b/console-tools/openvt.c
@@ -40,7 +40,7 @@ int openvt_main(int argc, char **argv)
40 close(0); /* so that new vt becomes stdin */ 40 close(0); /* so that new vt becomes stdin */
41 41
42 /* and grab new one */ 42 /* and grab new one */
43 fd = bb_xopen(vtname, O_RDWR); 43 fd = xopen(vtname, O_RDWR);
44 44
45 /* Reassign stdout and sterr */ 45 /* Reassign stdout and sterr */
46 dup2(fd, STDOUT_FILENO); 46 dup2(fd, STDOUT_FILENO);
diff --git a/console-tools/setconsole.c b/console-tools/setconsole.c
index 79a4313f0..71fe928da 100644
--- a/console-tools/setconsole.c
+++ b/console-tools/setconsole.c
@@ -7,13 +7,6 @@
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 */ 8 */
9 9
10#include <sys/ioctl.h>
11#include <sys/stat.h>
12#include <sys/types.h>
13#include <fcntl.h>
14#include <stdio.h>
15#include <getopt.h> /* struct option */
16
17#include "busybox.h" 10#include "busybox.h"
18 11
19#if ENABLE_FEATURE_SETCONSOLE_LONG_OPTIONS 12#if ENABLE_FEATURE_SETCONSOLE_LONG_OPTIONS
@@ -47,7 +40,7 @@ int setconsole_main(int argc, char **argv)
47 device = CONSOLE_DEV; 40 device = CONSOLE_DEV;
48 } 41 }
49 42
50 if (-1 == ioctl(bb_xopen(device, O_RDONLY), TIOCCONS)) { 43 if (-1 == ioctl(xopen(device, O_RDONLY), TIOCCONS)) {
51 bb_perror_msg_and_die("TIOCCONS"); 44 bb_perror_msg_and_die("TIOCCONS");
52 } 45 }
53 return EXIT_SUCCESS; 46 return EXIT_SUCCESS;
diff --git a/console-tools/setlogcons.c b/console-tools/setlogcons.c
index 62a654777..6667eb622 100644
--- a/console-tools/setlogcons.c
+++ b/console-tools/setlogcons.c
@@ -9,10 +9,6 @@
9 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 9 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
10 */ 10 */
11 11
12#include <stdio.h>
13#include <stdlib.h>
14#include <fcntl.h>
15#include <sys/ioctl.h>
16#include "busybox.h" 12#include "busybox.h"
17 13
18extern int setlogcons_main(int argc, char **argv) 14extern int setlogcons_main(int argc, char **argv)
@@ -28,7 +24,7 @@ extern int setlogcons_main(int argc, char **argv)
28 if (argc == 2) 24 if (argc == 2)
29 arg.subarg = atoi(argv[1]); 25 arg.subarg = atoi(argv[1]);
30 26
31 if (ioctl(bb_xopen(VC_1, O_RDONLY), TIOCLINUX, &arg)) 27 if (ioctl(xopen(VC_1, O_RDONLY), TIOCLINUX, &arg))
32 bb_perror_msg_and_die("TIOCLINUX");; 28 bb_perror_msg_and_die("TIOCLINUX");;
33 29
34 return 0; 30 return 0;