diff options
author | Eric Andersen | 2001-01-27 08:24:39 +0000 |
---|---|---|
committer | Eric Andersen | 2001-01-27 08:24:39 +0000 |
commit | ed3ef50c233ffb1b50ea0e7382a8e60b86491009 (patch) | |
tree | ecb05ce51890c2cf84ad036543a972ac812320c3 /coreutils | |
parent | ab050f5522e843bf08994685134adaaac7ffd392 (diff) | |
download | busybox-ed3ef50c233ffb1b50ea0e7382a8e60b86491009.zip busybox-ed3ef50c233ffb1b50ea0e7382a8e60b86491009.tar.gz |
Fix header file usage -- there were many unnecessary header files included in
busybox.h which slowed compiles. I left only what was needed and then fixed up
all the apps to include their own header files. I also fixed naming for pwd.h
and grp.h functions. Tested to compile and run with libc5, glibc, and uClibc.
-Erik
Diffstat (limited to 'coreutils')
37 files changed, 72 insertions, 7 deletions
diff --git a/coreutils/basename.c b/coreutils/basename.c index fcc7d46..0caae39 100644 --- a/coreutils/basename.c +++ b/coreutils/basename.c @@ -22,7 +22,8 @@ */ #include "busybox.h" -#include <stdio.h> +#include <stdlib.h> +#include <string.h> extern int basename_main(int argc, char **argv) { diff --git a/coreutils/cat.c b/coreutils/cat.c index 151ce4e..a1b8782 100644 --- a/coreutils/cat.c +++ b/coreutils/cat.c @@ -22,7 +22,7 @@ */ #include "busybox.h" -#include <stdio.h> +#include <stdlib.h> extern int cat_main(int argc, char **argv) { diff --git a/coreutils/chroot.c b/coreutils/chroot.c index 91d3407..e6f1d03 100644 --- a/coreutils/chroot.c +++ b/coreutils/chroot.c @@ -25,6 +25,7 @@ #include "busybox.h" #include <stdlib.h> #include <stdio.h> +#include <unistd.h> #include <errno.h> int chroot_main(int argc, char **argv) diff --git a/coreutils/cmp.c b/coreutils/cmp.c index 6b95544..a4b6c7d 100644 --- a/coreutils/cmp.c +++ b/coreutils/cmp.c @@ -26,6 +26,7 @@ #include <stdio.h> #include <string.h> #include <errno.h> +#include <stdlib.h> int cmp_main(int argc, char **argv) { diff --git a/coreutils/date.c b/coreutils/date.c index 73fc705..8b6a062 100644 --- a/coreutils/date.c +++ b/coreutils/date.c @@ -31,6 +31,7 @@ #include <unistd.h> #include <time.h> #include <stdio.h> +#include <string.h> #include <getopt.h> diff --git a/coreutils/dd.c b/coreutils/dd.c index 32eeb66..dac9ccd 100644 --- a/coreutils/dd.c +++ b/coreutils/dd.c @@ -24,6 +24,10 @@ #include "busybox.h" #include <sys/types.h> +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> #include <fcntl.h> static struct suffix_mult dd_suffixes[] = { diff --git a/coreutils/df.c b/coreutils/df.c index 22797fb..0408f9f 100644 --- a/coreutils/df.c +++ b/coreutils/df.c @@ -24,8 +24,10 @@ #include "busybox.h" #include <stdio.h> +#include <stdlib.h> #include <mntent.h> #include <sys/vfs.h> +#include <getopt.h> extern const char mtab_file[]; /* Defined in utility.c */ #ifdef BB_FEATURE_HUMAN_READABLE diff --git a/coreutils/dirname.c b/coreutils/dirname.c index 63c557a..333f08d 100644 --- a/coreutils/dirname.c +++ b/coreutils/dirname.c @@ -22,6 +22,8 @@ */ #include "busybox.h" #include <stdio.h> +#include <stdlib.h> +#include <string.h> extern int dirname_main(int argc, char **argv) { diff --git a/coreutils/du.c b/coreutils/du.c index 56a7a9a..9cc2a67 100644 --- a/coreutils/du.c +++ b/coreutils/du.c @@ -31,6 +31,8 @@ #include <fcntl.h> #include <dirent.h> #include <stdio.h> +#include <stdlib.h> +#include <getopt.h> #include <errno.h> #ifdef BB_FEATURE_HUMAN_READABLE @@ -185,7 +187,7 @@ int du_main(int argc, char **argv) return status; } -/* $Id: du.c,v 1.34 2001/01/22 22:35:38 rjune Exp $ */ +/* $Id: du.c,v 1.35 2001/01/27 08:24:37 andersen Exp $ */ /* Local Variables: c-file-style: "linux" diff --git a/coreutils/echo.c b/coreutils/echo.c index 393f442..b3e01af 100644 --- a/coreutils/echo.c +++ b/coreutils/echo.c @@ -24,6 +24,8 @@ #include "busybox.h" #include <stdio.h> +#include <string.h> +#include <stdlib.h> extern int echo_main(int argc, char** argv) diff --git a/coreutils/expr.c b/coreutils/expr.c index eed2637..71bd224 100644 --- a/coreutils/expr.c +++ b/coreutils/expr.c @@ -35,9 +35,11 @@ #include "busybox.h" #include <stdio.h> +#include <string.h> +#include <stdlib.h> +#include <regex.h> #include <sys/types.h> -#include <regex.h> /* The kinds of value we can have. */ enum valtype { diff --git a/coreutils/head.c b/coreutils/head.c index a0ca453..71aa825 100644 --- a/coreutils/head.c +++ b/coreutils/head.c @@ -25,6 +25,8 @@ #include "busybox.h" #include <errno.h> #include <stdio.h> +#include <getopt.h> +#include <stdlib.h> int head(int len, FILE *fp) { diff --git a/coreutils/hostid.c b/coreutils/hostid.c index 35a5859..eed1a50 100644 --- a/coreutils/hostid.c +++ b/coreutils/hostid.c @@ -22,6 +22,8 @@ #include "busybox.h" #include <stdio.h> +#include <stdlib.h> +#include <unistd.h> extern int hostid_main(int argc, char **argv) { diff --git a/coreutils/id.c b/coreutils/id.c index d50de47..e91ac75 100644 --- a/coreutils/id.c +++ b/coreutils/id.c @@ -24,6 +24,7 @@ #include <stdio.h> #include <unistd.h> #include <getopt.h> +#include <string.h> #include <sys/types.h> extern int id_main(int argc, char **argv) diff --git a/coreutils/ln.c b/coreutils/ln.c index e69cb02..d6bf644 100644 --- a/coreutils/ln.c +++ b/coreutils/ln.c @@ -28,7 +28,10 @@ #include <stdio.h> #include <dirent.h> +#include <string.h> +#include <stdlib.h> #include <errno.h> +#include <unistd.h> static const int LN_SYMLINK = 1; static const int LN_FORCE = 2; diff --git a/coreutils/logname.c b/coreutils/logname.c index d614e85..edec016 100644 --- a/coreutils/logname.c +++ b/coreutils/logname.c @@ -22,6 +22,8 @@ #include "busybox.h" #include <stdio.h> +#include <stdlib.h> +#include <unistd.h> extern int logname_main(int argc, char **argv) { diff --git a/coreutils/ls.c b/coreutils/ls.c index 4b225d6..affa48c 100644 --- a/coreutils/ls.c +++ b/coreutils/ls.c @@ -59,6 +59,7 @@ static const int COLUMN_GAP = 2; /* includes the file type char, if present */ #include <time.h> #endif #include <string.h> +#include <stdlib.h> #include <fcntl.h> #include <signal.h> diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c index 92357a6..eb6e7db 100644 --- a/coreutils/mkdir.c +++ b/coreutils/mkdir.c @@ -28,6 +28,8 @@ #include <stdio.h> #include <errno.h> +#include <string.h> +#include <stdlib.h> static int parentFlag = FALSE; static mode_t mode = 0777; diff --git a/coreutils/mkfifo.c b/coreutils/mkfifo.c index 728e1ec..b31e6f1 100644 --- a/coreutils/mkfifo.c +++ b/coreutils/mkfifo.c @@ -24,6 +24,7 @@ #include <stdio.h> #include <sys/types.h> #include <errno.h> +#include <stdlib.h> extern int mkfifo_main(int argc, char **argv) { diff --git a/coreutils/mknod.c b/coreutils/mknod.c index 4d8c598..c761aea 100644 --- a/coreutils/mknod.c +++ b/coreutils/mknod.c @@ -26,6 +26,8 @@ #include <sys/types.h> #include <fcntl.h> #include <unistd.h> +#include <string.h> +#include <stdlib.h> int mknod_main(int argc, char **argv) { diff --git a/coreutils/pwd.c b/coreutils/pwd.c index da089f3..a9acbc7 100644 --- a/coreutils/pwd.c +++ b/coreutils/pwd.c @@ -25,6 +25,8 @@ #include <stdio.h> #include <dirent.h> #include <errno.h> +#include <unistd.h> +#include <stdlib.h> extern int pwd_main(int argc, char **argv) { diff --git a/coreutils/rm.c b/coreutils/rm.c index a9501ec..302599e 100644 --- a/coreutils/rm.c +++ b/coreutils/rm.c @@ -28,6 +28,8 @@ #include <utime.h> #include <dirent.h> #include <errno.h> +#include <unistd.h> +#include <stdlib.h> static int recursiveFlag = FALSE; static int forceFlag = FALSE; diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c index f9f82bb..8c2165e 100644 --- a/coreutils/rmdir.c +++ b/coreutils/rmdir.c @@ -25,6 +25,8 @@ #include "busybox.h" #include <stdio.h> #include <errno.h> +#include <unistd.h> +#include <stdlib.h> extern int rmdir_main(int argc, char **argv) { diff --git a/coreutils/sleep.c b/coreutils/sleep.c index 10eca59..61b7ce4 100644 --- a/coreutils/sleep.c +++ b/coreutils/sleep.c @@ -23,6 +23,8 @@ #include "busybox.h" #include <stdio.h> +#include <unistd.h> +#include <stdlib.h> extern int sleep_main(int argc, char **argv) { diff --git a/coreutils/sort.c b/coreutils/sort.c index efff6b6..2aef2d9 100644 --- a/coreutils/sort.c +++ b/coreutils/sort.c @@ -22,6 +22,8 @@ */ #include "busybox.h" +#include <getopt.h> +#include <stdlib.h> int compare_ascii(const void *x, const void *y) { diff --git a/coreutils/sync.c b/coreutils/sync.c index 8f101cf..f95c24c 100644 --- a/coreutils/sync.c +++ b/coreutils/sync.c @@ -23,6 +23,7 @@ #include "busybox.h" #include <stdio.h> +#include <unistd.h> extern int sync_main(int argc, char **argv) { diff --git a/coreutils/tail.c b/coreutils/tail.c index dc5918d..40511aa 100644 --- a/coreutils/tail.c +++ b/coreutils/tail.c @@ -23,8 +23,12 @@ #include "busybox.h" -#include <sys/types.h> #include <fcntl.h> +#include <getopt.h> +#include <string.h> +#include <stdlib.h> +#include <unistd.h> +#include <sys/types.h> static struct suffix_mult tail_suffixes[] = { { "b", 512 }, diff --git a/coreutils/touch.c b/coreutils/touch.c index 1b03075..fa2f3b6 100644 --- a/coreutils/touch.c +++ b/coreutils/touch.c @@ -28,6 +28,8 @@ #include <fcntl.h> #include <utime.h> #include <errno.h> +#include <unistd.h> +#include <stdlib.h> extern int touch_main(int argc, char **argv) { diff --git a/coreutils/tr.c b/coreutils/tr.c index 15e3709..2717a92 100644 --- a/coreutils/tr.c +++ b/coreutils/tr.c @@ -191,9 +191,9 @@ extern int tr_main(int argc, char **argv) map(input, input_length, output, output_length); } for (i = 0; i < input_length; i++) - invec[input[i]] = TRUE; + invec[(int)input[i]] = TRUE; for (i = 0; i < output_length; i++) - outvec[output[i]] = TRUE; + outvec[(int)output[i]] = TRUE; } convert(); return (0); diff --git a/coreutils/tty.c b/coreutils/tty.c index 46201d3..2a64b14 100644 --- a/coreutils/tty.c +++ b/coreutils/tty.c @@ -22,6 +22,8 @@ #include "busybox.h" #include <stdio.h> +#include <stdlib.h> +#include <unistd.h> #include <sys/types.h> extern int tty_main(int argc, char **argv) diff --git a/coreutils/uname.c b/coreutils/uname.c index 4f7c643..deaffd7 100644 --- a/coreutils/uname.c +++ b/coreutils/uname.c @@ -33,6 +33,7 @@ #include "busybox.h" #include <stdio.h> +#include <stdlib.h> #include <sys/types.h> #include <sys/utsname.h> diff --git a/coreutils/uniq.c b/coreutils/uniq.c index c0229ae..2288559 100644 --- a/coreutils/uniq.c +++ b/coreutils/uniq.c @@ -26,7 +26,9 @@ #include "busybox.h" #include <stdio.h> #include <string.h> +#include <getopt.h> #include <errno.h> +#include <stdlib.h> static int print_count; static int print_uniq = 1; diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c index 7b26d2d..fcfcfd9 100644 --- a/coreutils/uudecode.c +++ b/coreutils/uudecode.c @@ -27,6 +27,10 @@ #include <stdio.h> #include <errno.h> #include <getopt.h> +#include <string.h> +#include <stdlib.h> +#include "pwd_grp/pwd.h" +#include "pwd_grp/grp.h" /*struct passwd *getpwnam();*/ diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c index 24aabd3..5df4902 100644 --- a/coreutils/uuencode.c +++ b/coreutils/uuencode.c @@ -27,6 +27,7 @@ #include <stdio.h> #include <errno.h> #include <getopt.h> +#include <stdlib.h> #define RW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) diff --git a/coreutils/wc.c b/coreutils/wc.c index e6f7534..619c161 100644 --- a/coreutils/wc.c +++ b/coreutils/wc.c @@ -23,6 +23,7 @@ #include "busybox.h" #include <stdio.h> #include <getopt.h> +#include <stdlib.h> static int total_lines, total_words, total_chars, max_length; static int print_lines, print_words, print_chars, print_length; diff --git a/coreutils/whoami.c b/coreutils/whoami.c index d7f0a17..870ede4 100644 --- a/coreutils/whoami.c +++ b/coreutils/whoami.c @@ -22,6 +22,8 @@ #include "busybox.h" #include <stdio.h> +#include <stdlib.h> +#include <unistd.h> extern int whoami_main(int argc, char **argv) { diff --git a/coreutils/yes.c b/coreutils/yes.c index 46873f3..0ce4949 100644 --- a/coreutils/yes.c +++ b/coreutils/yes.c @@ -22,6 +22,7 @@ #include "busybox.h" #include <stdio.h> +#include <stdlib.h> extern int yes_main(int argc, char **argv) { |