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 @@
*
*/
-#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> */
@@ -38,7 +31,7 @@ int dumpkmap_main(int argc, char **argv)
if (argc >= 2 && *argv[1] == '-')
bb_show_usage();
- fd = bb_xopen(CURRENT_VC, O_RDWR);
+ fd = xopen(CURRENT_VC, O_RDWR);
write(1, magic, 7);
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 @@
* Loads the console font, and possibly the corresponding screen map(s).
* (Adapted for busybox by Matej Vela.)
*/
-#include <stdio.h>
-#include <string.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <dirent.h>
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <sys/kd.h>
-#include <endian.h>
#include "busybox.h"
+#include <sys/kd.h>
enum{
PSF_MAGIC1 = 0x36,
@@ -47,7 +37,7 @@ int loadfont_main(int argc, char **argv)
if (argc != 1)
bb_show_usage();
- fd = bb_xopen(CURRENT_VC, O_RDWR);
+ fd = xopen(CURRENT_VC, O_RDWR);
loadnewfont(fd);
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 @@
*
*/
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
#include "busybox.h"
#define BINARY_KEYMAP_MAGIC "bkeymap"
@@ -43,7 +36,7 @@ int loadkmap_main(int argc, char **argv)
if (argc != 1)
bb_show_usage();
- fd = bb_xopen(CURRENT_VC, O_RDWR);
+ fd = xopen(CURRENT_VC, O_RDWR);
xread(0, buff, 7);
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)
close(0); /* so that new vt becomes stdin */
/* and grab new one */
- fd = bb_xopen(vtname, O_RDWR);
+ fd = xopen(vtname, O_RDWR);
/* Reassign stdout and sterr */
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 @@
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <getopt.h> /* struct option */
-
#include "busybox.h"
#if ENABLE_FEATURE_SETCONSOLE_LONG_OPTIONS
@@ -47,7 +40,7 @@ int setconsole_main(int argc, char **argv)
device = CONSOLE_DEV;
}
- if (-1 == ioctl(bb_xopen(device, O_RDONLY), TIOCCONS)) {
+ if (-1 == ioctl(xopen(device, O_RDONLY), TIOCCONS)) {
bb_perror_msg_and_die("TIOCCONS");
}
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 @@
* Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
#include "busybox.h"
extern int setlogcons_main(int argc, char **argv)
@@ -28,7 +24,7 @@ extern int setlogcons_main(int argc, char **argv)
if (argc == 2)
arg.subarg = atoi(argv[1]);
- if (ioctl(bb_xopen(VC_1, O_RDONLY), TIOCLINUX, &arg))
+ if (ioctl(xopen(VC_1, O_RDONLY), TIOCLINUX, &arg))
bb_perror_msg_and_die("TIOCLINUX");;
return 0;