aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/basename.c2
-rw-r--r--coreutils/cat.c2
-rw-r--r--coreutils/chroot.c2
-rw-r--r--coreutils/cmp.c2
-rw-r--r--coreutils/date.c10
-rw-r--r--coreutils/dd.c4
-rw-r--r--coreutils/df.c2
-rw-r--r--coreutils/dirname.c3
-rw-r--r--coreutils/dos2unix.c2
-rw-r--r--coreutils/du.c12
-rw-r--r--coreutils/echo.c2
-rw-r--r--coreutils/expr.c2
-rw-r--r--coreutils/head.c2
-rw-r--r--coreutils/hostid.c2
-rw-r--r--coreutils/length.c2
-rw-r--r--coreutils/ln.c10
-rw-r--r--coreutils/logname.c2
-rw-r--r--coreutils/ls.c2
-rw-r--r--coreutils/md5sum.c2
-rw-r--r--coreutils/mkdir.c8
-rw-r--r--coreutils/mkfifo.c2
-rw-r--r--coreutils/mknod.c4
-rw-r--r--coreutils/printf.c2
-rw-r--r--coreutils/pwd.c2
-rw-r--r--coreutils/rm.c2
-rw-r--r--coreutils/rmdir.c2
-rw-r--r--coreutils/sleep.c2
-rw-r--r--coreutils/sort.c2
-rw-r--r--coreutils/stty.c2
-rw-r--r--coreutils/sync.c2
-rw-r--r--coreutils/tail.c2
-rw-r--r--coreutils/test.c2
-rw-r--r--coreutils/touch.c2
-rw-r--r--coreutils/tr.c2
-rw-r--r--coreutils/tty.c2
-rw-r--r--coreutils/uname.c2
-rw-r--r--coreutils/uniq.c2
-rw-r--r--coreutils/usleep.c2
-rw-r--r--coreutils/uudecode.c2
-rw-r--r--coreutils/uuencode.c2
-rw-r--r--coreutils/wc.c2
-rw-r--r--coreutils/whoami.c2
-rw-r--r--coreutils/yes.c2
43 files changed, 62 insertions, 61 deletions
diff --git a/coreutils/basename.c b/coreutils/basename.c
index da59a8672..da0b7ecc3 100644
--- a/coreutils/basename.c
+++ b/coreutils/basename.c
@@ -21,8 +21,8 @@
21 * 21 *
22 */ 22 */
23 23
24#include "busybox.h"
25#include <stdlib.h> 24#include <stdlib.h>
25#include "busybox.h"
26#include <string.h> 26#include <string.h>
27 27
28extern int basename_main(int argc, char **argv) 28extern int basename_main(int argc, char **argv)
diff --git a/coreutils/cat.c b/coreutils/cat.c
index 134245cdc..3554008f8 100644
--- a/coreutils/cat.c
+++ b/coreutils/cat.c
@@ -21,8 +21,8 @@
21 * 21 *
22 */ 22 */
23 23
24#include "busybox.h"
25#include <stdlib.h> 24#include <stdlib.h>
25#include "busybox.h"
26 26
27extern int cat_main(int argc, char **argv) 27extern int cat_main(int argc, char **argv)
28{ 28{
diff --git a/coreutils/chroot.c b/coreutils/chroot.c
index e721e1ffa..bae9cd757 100644
--- a/coreutils/chroot.c
+++ b/coreutils/chroot.c
@@ -22,11 +22,11 @@
22 * 22 *
23 */ 23 */
24 24
25#include "busybox.h"
26#include <stdlib.h> 25#include <stdlib.h>
27#include <stdio.h> 26#include <stdio.h>
28#include <unistd.h> 27#include <unistd.h>
29#include <errno.h> 28#include <errno.h>
29#include "busybox.h"
30 30
31int chroot_main(int argc, char **argv) 31int chroot_main(int argc, char **argv)
32{ 32{
diff --git a/coreutils/cmp.c b/coreutils/cmp.c
index c04b6e1c9..24b6c3f92 100644
--- a/coreutils/cmp.c
+++ b/coreutils/cmp.c
@@ -22,11 +22,11 @@
22 * 22 *
23 */ 23 */
24 24
25#include "busybox.h"
26#include <stdio.h> 25#include <stdio.h>
27#include <string.h> 26#include <string.h>
28#include <errno.h> 27#include <errno.h>
29#include <stdlib.h> 28#include <stdlib.h>
29#include "busybox.h"
30 30
31int cmp_main(int argc, char **argv) 31int cmp_main(int argc, char **argv)
32{ 32{
diff --git a/coreutils/date.c b/coreutils/date.c
index 21d31bb25..878331f71 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -20,11 +20,6 @@
20 * 20 *
21*/ 21*/
22 22
23#include "busybox.h"
24#define BB_DECLARE_EXTERN
25#define bb_need_invalid_date
26#define bb_need_memory_exhausted
27#include "messages.c"
28#include <stdlib.h> 23#include <stdlib.h>
29#include <errno.h> 24#include <errno.h>
30#include <sys/time.h> 25#include <sys/time.h>
@@ -33,6 +28,11 @@
33#include <stdio.h> 28#include <stdio.h>
34#include <string.h> 29#include <string.h>
35#include <getopt.h> 30#include <getopt.h>
31#include "busybox.h"
32#define BB_DECLARE_EXTERN
33#define bb_need_invalid_date
34#define bb_need_memory_exhausted
35#include "messages.c"
36 36
37 37
38/* This 'date' command supports only 2 time setting formats, 38/* This 'date' command supports only 2 time setting formats,
diff --git a/coreutils/dd.c b/coreutils/dd.c
index e445e0435..1618dd102 100644
--- a/coreutils/dd.c
+++ b/coreutils/dd.c
@@ -21,14 +21,14 @@
21 * 21 *
22 */ 22 */
23 23
24#include "busybox.h"
25
26#include <sys/types.h> 24#include <sys/types.h>
27#include <stdlib.h> 25#include <stdlib.h>
28#include <stdio.h> 26#include <stdio.h>
29#include <unistd.h> 27#include <unistd.h>
30#include <string.h> 28#include <string.h>
31#include <fcntl.h> 29#include <fcntl.h>
30#include "busybox.h"
31
32 32
33static const struct suffix_mult dd_suffixes[] = { 33static const struct suffix_mult dd_suffixes[] = {
34 { "c", 1 }, 34 { "c", 1 },
diff --git a/coreutils/df.c b/coreutils/df.c
index 692205a0e..ebee4d607 100644
--- a/coreutils/df.c
+++ b/coreutils/df.c
@@ -22,12 +22,12 @@
22 * 22 *
23 */ 23 */
24 24
25#include "busybox.h"
26#include <stdio.h> 25#include <stdio.h>
27#include <stdlib.h> 26#include <stdlib.h>
28#include <mntent.h> 27#include <mntent.h>
29#include <sys/vfs.h> 28#include <sys/vfs.h>
30#include <getopt.h> 29#include <getopt.h>
30#include "busybox.h"
31 31
32extern const char mtab_file[]; /* Defined in utility.c */ 32extern const char mtab_file[]; /* Defined in utility.c */
33#ifdef BB_FEATURE_HUMAN_READABLE 33#ifdef BB_FEATURE_HUMAN_READABLE
diff --git a/coreutils/dirname.c b/coreutils/dirname.c
index e34ecf8a9..7f191c1b9 100644
--- a/coreutils/dirname.c
+++ b/coreutils/dirname.c
@@ -20,10 +20,11 @@
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 * 21 *
22 */ 22 */
23#include "busybox.h" 23
24#include <stdio.h> 24#include <stdio.h>
25#include <stdlib.h> 25#include <stdlib.h>
26#include <string.h> 26#include <string.h>
27#include "busybox.h"
27 28
28extern int dirname_main(int argc, char **argv) 29extern int dirname_main(int argc, char **argv)
29{ 30{
diff --git a/coreutils/dos2unix.c b/coreutils/dos2unix.c
index 32423611c..222c8f6a4 100644
--- a/coreutils/dos2unix.c
+++ b/coreutils/dos2unix.c
@@ -22,9 +22,9 @@
22 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23*/ 23*/
24 24
25#include "busybox.h"
26#include <stdio.h> 25#include <stdio.h>
27#include <stdlib.h> 26#include <stdlib.h>
27#include "busybox.h"
28 28
29int dos2unix_main( int argc, char **argv ) { 29int dos2unix_main( int argc, char **argv ) {
30 int c; 30 int c;
diff --git a/coreutils/du.c b/coreutils/du.c
index 516f4c92b..6197b0bc1 100644
--- a/coreutils/du.c
+++ b/coreutils/du.c
@@ -22,11 +22,6 @@
22 * 22 *
23 */ 23 */
24 24
25#include "busybox.h"
26#define BB_DECLARE_EXTERN
27#define bb_need_name_too_long
28#include "messages.c"
29
30#include <sys/types.h> 25#include <sys/types.h>
31#include <fcntl.h> 26#include <fcntl.h>
32#include <dirent.h> 27#include <dirent.h>
@@ -34,6 +29,11 @@
34#include <stdlib.h> 29#include <stdlib.h>
35#include <getopt.h> 30#include <getopt.h>
36#include <errno.h> 31#include <errno.h>
32#include "busybox.h"
33#define BB_DECLARE_EXTERN
34#define bb_need_name_too_long
35#include "messages.c"
36
37 37
38#ifdef BB_FEATURE_HUMAN_READABLE 38#ifdef BB_FEATURE_HUMAN_READABLE
39unsigned long du_disp_hr = KILOBYTE; 39unsigned long du_disp_hr = KILOBYTE;
@@ -187,7 +187,7 @@ int du_main(int argc, char **argv)
187 return status; 187 return status;
188} 188}
189 189
190/* $Id: du.c,v 1.37 2001/02/14 21:23:05 andersen Exp $ */ 190/* $Id: du.c,v 1.38 2001/02/20 06:14:07 andersen Exp $ */
191/* 191/*
192Local Variables: 192Local Variables:
193c-file-style: "linux" 193c-file-style: "linux"
diff --git a/coreutils/echo.c b/coreutils/echo.c
index b3e01afec..e9bc50a15 100644
--- a/coreutils/echo.c
+++ b/coreutils/echo.c
@@ -22,10 +22,10 @@
22 * Original copyright notice is retained at the end of this file. 22 * Original copyright notice is retained at the end of this file.
23 */ 23 */
24 24
25#include "busybox.h"
26#include <stdio.h> 25#include <stdio.h>
27#include <string.h> 26#include <string.h>
28#include <stdlib.h> 27#include <stdlib.h>
28#include "busybox.h"
29 29
30extern int 30extern int
31echo_main(int argc, char** argv) 31echo_main(int argc, char** argv)
diff --git a/coreutils/expr.c b/coreutils/expr.c
index 8ef5293c1..3b454bd3a 100644
--- a/coreutils/expr.c
+++ b/coreutils/expr.c
@@ -33,12 +33,12 @@
33 * One function can handle multiple operators all of equal precedence, 33 * One function can handle multiple operators all of equal precedence,
34 * provided they all associate ((x op x) op x). */ 34 * provided they all associate ((x op x) op x). */
35 35
36#include "busybox.h"
37#include <stdio.h> 36#include <stdio.h>
38#include <string.h> 37#include <string.h>
39#include <stdlib.h> 38#include <stdlib.h>
40#include <regex.h> 39#include <regex.h>
41#include <sys/types.h> 40#include <sys/types.h>
41#include "busybox.h"
42 42
43 43
44/* The kinds of value we can have. */ 44/* The kinds of value we can have. */
diff --git a/coreutils/head.c b/coreutils/head.c
index a2d774437..c683ec78a 100644
--- a/coreutils/head.c
+++ b/coreutils/head.c
@@ -22,11 +22,11 @@
22 * 22 *
23 */ 23 */
24 24
25#include "busybox.h"
26#include <errno.h> 25#include <errno.h>
27#include <stdio.h> 26#include <stdio.h>
28#include <getopt.h> 27#include <getopt.h>
29#include <stdlib.h> 28#include <stdlib.h>
29#include "busybox.h"
30 30
31int head(int len, FILE *fp) 31int head(int len, FILE *fp)
32{ 32{
diff --git a/coreutils/hostid.c b/coreutils/hostid.c
index eed1a50ec..68a2cc659 100644
--- a/coreutils/hostid.c
+++ b/coreutils/hostid.c
@@ -20,10 +20,10 @@
20 * 20 *
21 */ 21 */
22 22
23#include "busybox.h"
24#include <stdio.h> 23#include <stdio.h>
25#include <stdlib.h> 24#include <stdlib.h>
26#include <unistd.h> 25#include <unistd.h>
26#include "busybox.h"
27 27
28extern int hostid_main(int argc, char **argv) 28extern int hostid_main(int argc, char **argv)
29{ 29{
diff --git a/coreutils/length.c b/coreutils/length.c
index 9119adca8..73becd28a 100644
--- a/coreutils/length.c
+++ b/coreutils/length.c
@@ -1,8 +1,8 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2#include "busybox.h"
3#include <stdlib.h> 2#include <stdlib.h>
4#include <string.h> 3#include <string.h>
5#include <stdio.h> 4#include <stdio.h>
5#include "busybox.h"
6 6
7extern int length_main(int argc, char **argv) 7extern int length_main(int argc, char **argv)
8{ 8{
diff --git a/coreutils/ln.c b/coreutils/ln.c
index e35bf7a03..6d41cce62 100644
--- a/coreutils/ln.c
+++ b/coreutils/ln.c
@@ -21,17 +21,17 @@
21 * 21 *
22 */ 22 */
23 23
24#include "busybox.h"
25#define BB_DECLARE_EXTERN
26#define bb_need_not_a_directory
27#include "messages.c"
28
29#include <stdio.h> 24#include <stdio.h>
30#include <dirent.h> 25#include <dirent.h>
31#include <string.h> 26#include <string.h>
32#include <stdlib.h> 27#include <stdlib.h>
33#include <errno.h> 28#include <errno.h>
34#include <unistd.h> 29#include <unistd.h>
30#include "busybox.h"
31#define BB_DECLARE_EXTERN
32#define bb_need_not_a_directory
33#include "messages.c"
34
35 35
36static const int LN_SYMLINK = 1; 36static const int LN_SYMLINK = 1;
37static const int LN_FORCE = 2; 37static const int LN_FORCE = 2;
diff --git a/coreutils/logname.c b/coreutils/logname.c
index a1887aaf9..0924b2471 100644
--- a/coreutils/logname.c
+++ b/coreutils/logname.c
@@ -20,10 +20,10 @@
20 * 20 *
21 */ 21 */
22 22
23#include "busybox.h"
24#include <stdio.h> 23#include <stdio.h>
25#include <stdlib.h> 24#include <stdlib.h>
26#include <unistd.h> 25#include <unistd.h>
26#include "busybox.h"
27 27
28extern int logname_main(int argc, char **argv) 28extern int logname_main(int argc, char **argv)
29{ 29{
diff --git a/coreutils/ls.c b/coreutils/ls.c
index dd38dd5f3..a619bb8b2 100644
--- a/coreutils/ls.c
+++ b/coreutils/ls.c
@@ -50,7 +50,6 @@ enum {
50 50
51/************************************************************************/ 51/************************************************************************/
52 52
53#include "busybox.h"
54#include <sys/types.h> 53#include <sys/types.h>
55#include <sys/stat.h> 54#include <sys/stat.h>
56#include <stdio.h> 55#include <stdio.h>
@@ -67,6 +66,7 @@ enum {
67#include <fcntl.h> 66#include <fcntl.h>
68#include <signal.h> 67#include <signal.h>
69#include <sys/ioctl.h> 68#include <sys/ioctl.h>
69#include "busybox.h"
70 70
71#ifndef MAJOR 71#ifndef MAJOR
72#define MAJOR(dev) (((dev)>>8)&0xff) 72#define MAJOR(dev) (((dev)>>8)&0xff)
diff --git a/coreutils/md5sum.c b/coreutils/md5sum.c
index 3decafdf4..fa11ee61d 100644
--- a/coreutils/md5sum.c
+++ b/coreutils/md5sum.c
@@ -20,11 +20,11 @@
20/* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu> */ 20/* Written by Ulrich Drepper <drepper@gnu.ai.mit.edu> */
21/* Hacked to work with BusyBox by Alfred M. Szmidt <ams@trillian.itslinux.org> */ 21/* Hacked to work with BusyBox by Alfred M. Szmidt <ams@trillian.itslinux.org> */
22 22
23#include "busybox.h"
24#include <stdio.h> 23#include <stdio.h>
25#include <errno.h> 24#include <errno.h>
26#include <ctype.h> 25#include <ctype.h>
27#include <getopt.h> 26#include <getopt.h>
27#include "busybox.h"
28 28
29/* For some silly reason, this file uses backwards TRUE and FALSE conventions */ 29/* For some silly reason, this file uses backwards TRUE and FALSE conventions */
30#undef TRUE 30#undef TRUE
diff --git a/coreutils/mkdir.c b/coreutils/mkdir.c
index 285d34f12..902da7c99 100644
--- a/coreutils/mkdir.c
+++ b/coreutils/mkdir.c
@@ -21,15 +21,15 @@
21 * 21 *
22 */ 22 */
23 23
24#include <stdio.h>
25#include <errno.h>
26#include <string.h>
27#include <stdlib.h>
24#include "busybox.h" 28#include "busybox.h"
25#define bb_need_name_too_long 29#define bb_need_name_too_long
26#define BB_DECLARE_EXTERN 30#define BB_DECLARE_EXTERN
27#include "messages.c" 31#include "messages.c"
28 32
29#include <stdio.h>
30#include <errno.h>
31#include <string.h>
32#include <stdlib.h>
33 33
34static int parentFlag = FALSE; 34static int parentFlag = FALSE;
35static mode_t mode = 0777; 35static mode_t mode = 0777;
diff --git a/coreutils/mkfifo.c b/coreutils/mkfifo.c
index 56a04f772..ca217fa23 100644
--- a/coreutils/mkfifo.c
+++ b/coreutils/mkfifo.c
@@ -20,11 +20,11 @@
20 * 20 *
21 */ 21 */
22 22
23#include "busybox.h"
24#include <stdio.h> 23#include <stdio.h>
25#include <sys/types.h> 24#include <sys/types.h>
26#include <errno.h> 25#include <errno.h>
27#include <stdlib.h> 26#include <stdlib.h>
27#include "busybox.h"
28 28
29extern int mkfifo_main(int argc, char **argv) 29extern int mkfifo_main(int argc, char **argv)
30{ 30{
diff --git a/coreutils/mknod.c b/coreutils/mknod.c
index 73f6e06f1..b4d4b82a1 100644
--- a/coreutils/mknod.c
+++ b/coreutils/mknod.c
@@ -20,14 +20,14 @@
20 * 20 *
21 */ 21 */
22 22
23#include "busybox.h"
24#include <stdio.h> 23#include <stdio.h>
25#include <errno.h> 24#include <errno.h>
26#include <sys/types.h>
27#include <fcntl.h> 25#include <fcntl.h>
28#include <unistd.h> 26#include <unistd.h>
29#include <string.h> 27#include <string.h>
30#include <stdlib.h> 28#include <stdlib.h>
29#include <sys/types.h>
30#include "busybox.h"
31 31
32int mknod_main(int argc, char **argv) 32int mknod_main(int argc, char **argv)
33{ 33{
diff --git a/coreutils/printf.c b/coreutils/printf.c
index 26a200e85..003423d56 100644
--- a/coreutils/printf.c
+++ b/coreutils/printf.c
@@ -47,7 +47,6 @@
47 47
48// 19990508 Busy Boxed! Dave Cinege 48// 19990508 Busy Boxed! Dave Cinege
49 49
50#include "busybox.h"
51#include <unistd.h> 50#include <unistd.h>
52#include <stdio.h> 51#include <stdio.h>
53#include <sys/types.h> 52#include <sys/types.h>
@@ -56,6 +55,7 @@
56#include <stdlib.h> 55#include <stdlib.h>
57#include <fcntl.h> 56#include <fcntl.h>
58#include <ctype.h> 57#include <ctype.h>
58#include "busybox.h"
59 59
60 60
61#ifndef S_IFMT 61#ifndef S_IFMT
diff --git a/coreutils/pwd.c b/coreutils/pwd.c
index a9acbc721..a7a5f78a1 100644
--- a/coreutils/pwd.c
+++ b/coreutils/pwd.c
@@ -21,12 +21,12 @@
21 * 21 *
22 */ 22 */
23 23
24#include "busybox.h"
25#include <stdio.h> 24#include <stdio.h>
26#include <dirent.h> 25#include <dirent.h>
27#include <errno.h> 26#include <errno.h>
28#include <unistd.h> 27#include <unistd.h>
29#include <stdlib.h> 28#include <stdlib.h>
29#include "busybox.h"
30 30
31extern int pwd_main(int argc, char **argv) 31extern int pwd_main(int argc, char **argv)
32{ 32{
diff --git a/coreutils/rm.c b/coreutils/rm.c
index 566076707..a84163272 100644
--- a/coreutils/rm.c
+++ b/coreutils/rm.c
@@ -22,7 +22,6 @@
22 * 22 *
23 */ 23 */
24 24
25#include "busybox.h"
26#include <stdio.h> 25#include <stdio.h>
27#include <time.h> 26#include <time.h>
28#include <utime.h> 27#include <utime.h>
@@ -30,6 +29,7 @@
30#include <errno.h> 29#include <errno.h>
31#include <unistd.h> 30#include <unistd.h>
32#include <stdlib.h> 31#include <stdlib.h>
32#include "busybox.h"
33 33
34static int recursiveFlag = FALSE; 34static int recursiveFlag = FALSE;
35static int forceFlag = FALSE; 35static int forceFlag = FALSE;
diff --git a/coreutils/rmdir.c b/coreutils/rmdir.c
index 6266ce1ef..2c280376f 100644
--- a/coreutils/rmdir.c
+++ b/coreutils/rmdir.c
@@ -22,11 +22,11 @@
22 * 22 *
23 */ 23 */
24 24
25#include "busybox.h"
26#include <stdio.h> 25#include <stdio.h>
27#include <errno.h> 26#include <errno.h>
28#include <unistd.h> 27#include <unistd.h>
29#include <stdlib.h> 28#include <stdlib.h>
29#include "busybox.h"
30 30
31extern int rmdir_main(int argc, char **argv) 31extern int rmdir_main(int argc, char **argv)
32{ 32{
diff --git a/coreutils/sleep.c b/coreutils/sleep.c
index d21af19b3..3bcab88ee 100644
--- a/coreutils/sleep.c
+++ b/coreutils/sleep.c
@@ -21,10 +21,10 @@
21 * 21 *
22 */ 22 */
23 23
24#include "busybox.h"
25#include <stdio.h> 24#include <stdio.h>
26#include <unistd.h> 25#include <unistd.h>
27#include <stdlib.h> 26#include <stdlib.h>
27#include "busybox.h"
28 28
29extern int sleep_main(int argc, char **argv) 29extern int sleep_main(int argc, char **argv)
30{ 30{
diff --git a/coreutils/sort.c b/coreutils/sort.c
index 4984f5dfe..ed6872218 100644
--- a/coreutils/sort.c
+++ b/coreutils/sort.c
@@ -21,9 +21,9 @@
21 * 21 *
22 */ 22 */
23 23
24#include "busybox.h"
25#include <getopt.h> 24#include <getopt.h>
26#include <stdlib.h> 25#include <stdlib.h>
26#include "busybox.h"
27 27
28int compare_ascii(const void *x, const void *y) 28int compare_ascii(const void *x, const void *y)
29{ 29{
diff --git a/coreutils/stty.c b/coreutils/stty.c
index 4a5aecf1d..10e28254d 100644
--- a/coreutils/stty.c
+++ b/coreutils/stty.c
@@ -28,7 +28,6 @@
28 28
29 */ 29 */
30 30
31#include "busybox.h"
32 31
33#include <termios.h> 32#include <termios.h>
34#include <sys/ioctl.h> 33#include <sys/ioctl.h>
@@ -53,6 +52,7 @@
53#include <limits.h> 52#include <limits.h>
54#include <memory.h> 53#include <memory.h>
55#include <fcntl.h> 54#include <fcntl.h>
55#include "busybox.h"
56 56
57#define STREQ(a, b) (strcmp ((a), (b)) == 0) 57#define STREQ(a, b) (strcmp ((a), (b)) == 0)
58 58
diff --git a/coreutils/sync.c b/coreutils/sync.c
index 3d4686efa..ee22ae109 100644
--- a/coreutils/sync.c
+++ b/coreutils/sync.c
@@ -21,10 +21,10 @@
21 * 21 *
22 */ 22 */
23 23
24#include "busybox.h"
25#include <stdio.h> 24#include <stdio.h>
26#include <stdlib.h> 25#include <stdlib.h>
27#include <unistd.h> 26#include <unistd.h>
27#include "busybox.h"
28 28
29extern int sync_main(int argc, char **argv) 29extern int sync_main(int argc, char **argv)
30{ 30{
diff --git a/coreutils/tail.c b/coreutils/tail.c
index 778c2d18b..a85256c80 100644
--- a/coreutils/tail.c
+++ b/coreutils/tail.c
@@ -21,7 +21,6 @@
21 * 21 *
22 */ 22 */
23 23
24#include "busybox.h"
25 24
26#include <fcntl.h> 25#include <fcntl.h>
27#include <getopt.h> 26#include <getopt.h>
@@ -29,6 +28,7 @@
29#include <stdlib.h> 28#include <stdlib.h>
30#include <unistd.h> 29#include <unistd.h>
31#include <sys/types.h> 30#include <sys/types.h>
31#include "busybox.h"
32 32
33static const struct suffix_mult tail_suffixes[] = { 33static const struct suffix_mult tail_suffixes[] = {
34 { "b", 512 }, 34 { "b", 512 },
diff --git a/coreutils/test.c b/coreutils/test.c
index 6439e3a8a..ab9c23e4b 100644
--- a/coreutils/test.c
+++ b/coreutils/test.c
@@ -31,13 +31,13 @@
31 * "This program is in the Public Domain." 31 * "This program is in the Public Domain."
32 */ 32 */
33 33
34#include "busybox.h"
35#include <sys/types.h> 34#include <sys/types.h>
36#include <unistd.h> 35#include <unistd.h>
37#include <ctype.h> 36#include <ctype.h>
38#include <errno.h> 37#include <errno.h>
39#include <stdlib.h> 38#include <stdlib.h>
40#include <string.h> 39#include <string.h>
40#include "busybox.h"
41#define BB_DECLARE_EXTERN 41#define BB_DECLARE_EXTERN
42#define bb_need_help 42#define bb_need_help
43#include "messages.c" 43#include "messages.c"
diff --git a/coreutils/touch.c b/coreutils/touch.c
index a3256d559..1718da71e 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -22,7 +22,6 @@
22 * 22 *
23 */ 23 */
24 24
25#include "busybox.h"
26#include <stdio.h> 25#include <stdio.h>
27#include <sys/types.h> 26#include <sys/types.h>
28#include <fcntl.h> 27#include <fcntl.h>
@@ -30,6 +29,7 @@
30#include <errno.h> 29#include <errno.h>
31#include <unistd.h> 30#include <unistd.h>
32#include <stdlib.h> 31#include <stdlib.h>
32#include "busybox.h"
33 33
34extern int touch_main(int argc, char **argv) 34extern int touch_main(int argc, char **argv)
35{ 35{
diff --git a/coreutils/tr.c b/coreutils/tr.c
index 92f399e14..b7a6009c8 100644
--- a/coreutils/tr.c
+++ b/coreutils/tr.c
@@ -24,12 +24,12 @@
24 * Original copyright notice is retained at the end of this file. 24 * Original copyright notice is retained at the end of this file.
25 */ 25 */
26 26
27#include "busybox.h"
28#include <stdio.h> 27#include <stdio.h>
29#include <string.h> 28#include <string.h>
30#include <stdlib.h> 29#include <stdlib.h>
31#include <unistd.h> 30#include <unistd.h>
32#include <sys/types.h> 31#include <sys/types.h>
32#include "busybox.h"
33#define BB_DECLARE_EXTERN 33#define BB_DECLARE_EXTERN
34#define bb_need_write_error 34#define bb_need_write_error
35#include "messages.c" 35#include "messages.c"
diff --git a/coreutils/tty.c b/coreutils/tty.c
index d71d8dedb..4510c2996 100644
--- a/coreutils/tty.c
+++ b/coreutils/tty.c
@@ -20,11 +20,11 @@
20 * 20 *
21 */ 21 */
22 22
23#include "busybox.h"
24#include <stdio.h> 23#include <stdio.h>
25#include <stdlib.h> 24#include <stdlib.h>
26#include <unistd.h> 25#include <unistd.h>
27#include <sys/types.h> 26#include <sys/types.h>
27#include "busybox.h"
28 28
29extern int tty_main(int argc, char **argv) 29extern int tty_main(int argc, char **argv)
30{ 30{
diff --git a/coreutils/uname.c b/coreutils/uname.c
index 899da7792..4931ff1d8 100644
--- a/coreutils/uname.c
+++ b/coreutils/uname.c
@@ -31,7 +31,6 @@
31 31
32/* Busyboxed by Erik Andersen */ 32/* Busyboxed by Erik Andersen */
33 33
34#include "busybox.h"
35#include <stdio.h> 34#include <stdio.h>
36#include <stdlib.h> 35#include <stdlib.h>
37#include <sys/types.h> 36#include <sys/types.h>
@@ -40,6 +39,7 @@
40#if defined (HAVE_SYSINFO) && defined (HAVE_SYS_SYSTEMINFO_H) 39#if defined (HAVE_SYSINFO) && defined (HAVE_SYS_SYSTEMINFO_H)
41# include <sys/systeminfo.h> 40# include <sys/systeminfo.h>
42#endif 41#endif
42#include "busybox.h"
43 43
44static void print_element(unsigned int mask, char *element); 44static void print_element(unsigned int mask, char *element);
45 45
diff --git a/coreutils/uniq.c b/coreutils/uniq.c
index 84f1ed231..53e3c64f2 100644
--- a/coreutils/uniq.c
+++ b/coreutils/uniq.c
@@ -23,12 +23,12 @@
23 * 23 *
24 */ 24 */
25 25
26#include "busybox.h"
27#include <stdio.h> 26#include <stdio.h>
28#include <string.h> 27#include <string.h>
29#include <getopt.h> 28#include <getopt.h>
30#include <errno.h> 29#include <errno.h>
31#include <stdlib.h> 30#include <stdlib.h>
31#include "busybox.h"
32 32
33static int print_count; 33static int print_count;
34static int print_uniq = 1; 34static int print_uniq = 1;
diff --git a/coreutils/usleep.c b/coreutils/usleep.c
index c67c365b8..92e4437c5 100644
--- a/coreutils/usleep.c
+++ b/coreutils/usleep.c
@@ -21,9 +21,9 @@
21 * 21 *
22 */ 22 */
23 23
24#include "busybox.h"
25#include <stdlib.h> 24#include <stdlib.h>
26#include <unistd.h> 25#include <unistd.h>
26#include "busybox.h"
27 27
28extern int usleep_main(int argc, char **argv) 28extern int usleep_main(int argc, char **argv)
29{ 29{
diff --git a/coreutils/uudecode.c b/coreutils/uudecode.c
index c0e8cea8c..6a3f78a42 100644
--- a/coreutils/uudecode.c
+++ b/coreutils/uudecode.c
@@ -22,13 +22,13 @@
22 */ 22 */
23 23
24 24
25#include "busybox.h"
26 25
27#include <stdio.h> 26#include <stdio.h>
28#include <errno.h> 27#include <errno.h>
29#include <getopt.h> 28#include <getopt.h>
30#include <string.h> 29#include <string.h>
31#include <stdlib.h> 30#include <stdlib.h>
31#include "busybox.h"
32#include "pwd_grp/pwd.h" 32#include "pwd_grp/pwd.h"
33#include "pwd_grp/grp.h" 33#include "pwd_grp/grp.h"
34 34
diff --git a/coreutils/uuencode.c b/coreutils/uuencode.c
index 8d5af4a8a..41541defb 100644
--- a/coreutils/uuencode.c
+++ b/coreutils/uuencode.c
@@ -22,12 +22,12 @@
22/* Hacked to work with BusyBox by Alfred M. Szmidt */ 22/* Hacked to work with BusyBox by Alfred M. Szmidt */
23 23
24 24
25#include "busybox.h"
26 25
27#include <stdio.h> 26#include <stdio.h>
28#include <errno.h> 27#include <errno.h>
29#include <getopt.h> 28#include <getopt.h>
30#include <stdlib.h> 29#include <stdlib.h>
30#include "busybox.h"
31 31
32#define RW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) 32#define RW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
33 33
diff --git a/coreutils/wc.c b/coreutils/wc.c
index f41687422..f2d33d6f3 100644
--- a/coreutils/wc.c
+++ b/coreutils/wc.c
@@ -20,10 +20,10 @@
20 * 20 *
21 */ 21 */
22 22
23#include "busybox.h"
24#include <stdio.h> 23#include <stdio.h>
25#include <getopt.h> 24#include <getopt.h>
26#include <stdlib.h> 25#include <stdlib.h>
26#include "busybox.h"
27 27
28static int total_lines, total_words, total_chars, max_length; 28static int total_lines, total_words, total_chars, max_length;
29static int print_lines, print_words, print_chars, print_length; 29static int print_lines, print_words, print_chars, print_length;
diff --git a/coreutils/whoami.c b/coreutils/whoami.c
index 54df0bf12..0bbb54b7b 100644
--- a/coreutils/whoami.c
+++ b/coreutils/whoami.c
@@ -20,10 +20,10 @@
20 * 20 *
21 */ 21 */
22 22
23#include "busybox.h"
24#include <stdio.h> 23#include <stdio.h>
25#include <stdlib.h> 24#include <stdlib.h>
26#include <unistd.h> 25#include <unistd.h>
26#include "busybox.h"
27 27
28extern int whoami_main(int argc, char **argv) 28extern int whoami_main(int argc, char **argv)
29{ 29{
diff --git a/coreutils/yes.c b/coreutils/yes.c
index 0a8ad83a7..ad7b98f84 100644
--- a/coreutils/yes.c
+++ b/coreutils/yes.c
@@ -20,9 +20,9 @@
20 * 20 *
21 */ 21 */
22 22
23#include "busybox.h"
24#include <stdio.h> 23#include <stdio.h>
25#include <stdlib.h> 24#include <stdlib.h>
25#include "busybox.h"
26 26
27extern int yes_main(int argc, char **argv) 27extern int yes_main(int argc, char **argv)
28{ 28{