summaryrefslogtreecommitdiff
path: root/console-tools
diff options
context:
space:
mode:
authorRob Landley2006-08-03 15:41:12 +0000
committerRob Landley2006-08-03 15:41:12 +0000
commitd921b2ecc0d294ad4bf8c7458fc52a60c28727d2 (patch)
treee4a2769349867c441cf2983d83097bb66701a733 /console-tools
parent6dce0b6fa79f2d4bb7e9d90e1fbc0f6beb25f855 (diff)
downloadbusybox-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.zip
busybox-d921b2ecc0d294ad4bf8c7458fc52a60c28727d2.tar.gz
Remove bb_ prefixes from xfuncs.c (and a few other places), consolidate
things like xasprintf() into xfuncs.c, remove xprint_file_by_name() (it only had one user), clean up lots of #includes... General cleanup pass. What I've been doing for the last couple days. And it conflicts! I've removed httpd.c from this checkin due to somebody else touching that file. It builds for me. I have to catch a bus. (Now you know why I'm looking forward to Mercurial.)
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 62313e7..7c6633a 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 2421cad..3d85885 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 69d33bd..ec55c39 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 948dba7..0c0cef2 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 79a4313..71fe928 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 62a6547..6667eb6 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;