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.)
This commit is contained in:
Rob Landley
2006-08-03 15:41:12 +00:00
parent 6dce0b6fa7
commit d921b2ecc0
143 changed files with 711 additions and 1721 deletions

View File

@@ -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);

View File

@@ -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;

View File

@@ -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))

View File

@@ -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);

View File

@@ -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;

View File

@@ -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;