aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-06-02 20:56:16 +0000
committeraldot <aldot@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-06-02 20:56:16 +0000
commit96d9a06694110826a348a616abc536765a86d4fd (patch)
tree09e7b482b38ac571a01e936fb91df16dd1eeef42
parentee7674aa004d1bf4b89c321d99549ab59de606ab (diff)
downloadbusybox-w32-96d9a06694110826a348a616abc536765a86d4fd.tar.gz
busybox-w32-96d9a06694110826a348a616abc536765a86d4fd.tar.bz2
busybox-w32-96d9a06694110826a348a616abc536765a86d4fd.zip
- move #include busybox.h to the very top so we pull in the config
and eventual platform specific includes in early. git-svn-id: svn://busybox.net/trunk/busybox@15267 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--applets/applets.c2
-rw-r--r--applets/busybox.c4
-rw-r--r--applets/version.c7
-rw-r--r--debianutils/mktemp.c2
-rw-r--r--debianutils/pipe_progress.c29
-rw-r--r--debianutils/readlink.c5
-rw-r--r--debianutils/run_parts.c18
-rw-r--r--debianutils/start_stop_daemon.c3
-rw-r--r--debianutils/which.c2
-rw-r--r--docs/new-applet-HOWTO.txt4
-rw-r--r--findutils/find.c17
-rw-r--r--findutils/grep.c2
-rw-r--r--findutils/xargs.c17
-rw-r--r--init/halt.c5
-rw-r--r--init/init_shared.c2
-rw-r--r--init/init_shared.h6
-rw-r--r--init/mesg.c21
-rw-r--r--procps/free.c17
-rw-r--r--procps/fuser.c3
-rw-r--r--procps/kill.c18
-rw-r--r--procps/pidof.c3
-rw-r--r--procps/ps.c2
-rw-r--r--procps/renice.c17
-rw-r--r--procps/sysctl.c4
-rw-r--r--procps/top.c2
-rw-r--r--procps/uptime.c18
-rw-r--r--shell/ash.c7
-rw-r--r--shell/cmdedit.c3
-rw-r--r--shell/hush.c3
-rw-r--r--shell/lash.c2
-rw-r--r--shell/msh.c2
-rw-r--r--sysklogd/klogd.c3
-rw-r--r--sysklogd/logger.c17
-rw-r--r--sysklogd/syslogd.c3
34 files changed, 77 insertions, 193 deletions
diff --git a/applets/applets.c b/applets/applets.c
index 1913676dc..aea116add 100644
--- a/applets/applets.c
+++ b/applets/applets.c
@@ -12,12 +12,12 @@
12 * Licensed under GPLv2 or later, see file License in this tarball for details. 12 * Licensed under GPLv2 or later, see file License in this tarball for details.
13 */ 13 */
14 14
15#include "busybox.h"
15#include <unistd.h> 16#include <unistd.h>
16#include <stdio.h> 17#include <stdio.h>
17#include <stdlib.h> 18#include <stdlib.h>
18#include <string.h> 19#include <string.h>
19#include <assert.h> 20#include <assert.h>
20#include "busybox.h"
21 21
22#if ENABLE_SHOW_USAGE && !ENABLE_FEATURE_COMPRESS_USAGE 22#if ENABLE_SHOW_USAGE && !ENABLE_FEATURE_COMPRESS_USAGE
23static const char usage_messages[] = 23static const char usage_messages[] =
diff --git a/applets/busybox.c b/applets/busybox.c
index 25bb36d9c..a92ddbd0e 100644
--- a/applets/busybox.c
+++ b/applets/busybox.c
@@ -1,13 +1,15 @@
1/* vi: set sw=4 ts=4: */ 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * BusyBox' main applet dispatcher.
4 *
3 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 5 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
4 */ 6 */
7#include "busybox.h"
5#include <stdio.h> 8#include <stdio.h>
6#include <string.h> 9#include <string.h>
7#include <unistd.h> 10#include <unistd.h>
8#include <errno.h> 11#include <errno.h>
9#include <stdlib.h> 12#include <stdlib.h>
10#include "busybox.h"
11#if ENABLE_LOCALE_SUPPORT 13#if ENABLE_LOCALE_SUPPORT
12#include <locale.h> 14#include <locale.h>
13#else 15#else
diff --git a/applets/version.c b/applets/version.c
index 6f6ec24ff..ce75f1ff9 100644
--- a/applets/version.c
+++ b/applets/version.c
@@ -1,3 +1,10 @@
1/* vi: set sw=4 ts=4: */
2/*
3 * Version stuff.
4 *
5 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
6 */
7
1#include "busybox.h" 8#include "busybox.h"
2 9
3#ifndef BB_EXTRA_VERSION 10#ifndef BB_EXTRA_VERSION
diff --git a/debianutils/mktemp.c b/debianutils/mktemp.c
index 09c79f504..495a2ea3a 100644
--- a/debianutils/mktemp.c
+++ b/debianutils/mktemp.c
@@ -9,12 +9,12 @@
9 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. 9 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
10 */ 10 */
11 11
12#include "busybox.h"
12#include <stdio.h> 13#include <stdio.h>
13#include <errno.h> 14#include <errno.h>
14#include <string.h> 15#include <string.h>
15#include <unistd.h> 16#include <unistd.h>
16#include <stdlib.h> 17#include <stdlib.h>
17#include "busybox.h"
18 18
19int mktemp_main(int argc, char **argv) 19int mktemp_main(int argc, char **argv)
20{ 20{
diff --git a/debianutils/pipe_progress.c b/debianutils/pipe_progress.c
index 95db16783..75d26e20f 100644
--- a/debianutils/pipe_progress.c
+++ b/debianutils/pipe_progress.c
@@ -1,35 +1,22 @@
1/* vi: set sw=4 ts=4: */
1/* 2/*
2 * Monitor a pipe with a simple progress display. 3 * Monitor a pipe with a simple progress display.
3 * 4 *
4 * Copyright (C) 2003 by Rob Landley <rob@landley.net>, Joey Hess 5 * Copyright (C) 2003 by Rob Landley <rob@landley.net>, Joey Hess
5 * 6 *
6 * This program is free software; you can redistribute it and/or modify 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 *
20 */ 8 */
21 9
10#include "busybox.h"
22#include <stdio.h> 11#include <stdio.h>
23#include <stdlib.h> 12#include <stdlib.h>
24#include <unistd.h> 13#include <unistd.h>
25#include <time.h> 14#include <time.h>
26 15
27#include "busybox.h"
28
29#define PIPE_PROGRESS_SIZE 4096 16#define PIPE_PROGRESS_SIZE 4096
30 17
31/* Read a block of data from stdin, write it to stdout. 18/* Read a block of data from stdin, write it to stdout.
32 * Activity is indicated by a '.' to stderr 19 * Activity is indicated by a '.' to stderr
33 */ 20 */
34int pipe_progress_main(int argc, char **argv) 21int pipe_progress_main(int argc, char **argv)
35{ 22{
@@ -48,8 +35,8 @@ int pipe_progress_main(int argc, char **argv)
48 35
49 fputc('\n', stderr); 36 fputc('\n', stderr);
50 37
51#ifdef CONFIG_FEATURE_CLEAN_UP 38 if (ENABLE_FEATURE_CLEAN_UP)
52 RELEASE_CONFIG_BUFFER(buf); 39 RELEASE_CONFIG_BUFFER(buf);
53#endif 40
54 return 0; 41 return 0;
55} 42}
diff --git a/debianutils/readlink.c b/debianutils/readlink.c
index 79f0870ec..10fb01ebf 100644
--- a/debianutils/readlink.c
+++ b/debianutils/readlink.c
@@ -7,11 +7,11 @@
7 * Licensed under GPL v2, see file LICENSE in this tarball for details. 7 * Licensed under GPL v2, see file LICENSE in this tarball for details.
8 */ 8 */
9 9
10#include "busybox.h"
10#include <errno.h> 11#include <errno.h>
11#include <unistd.h> 12#include <unistd.h>
12#include <stdlib.h> 13#include <stdlib.h>
13#include <getopt.h> 14#include <getopt.h>
14#include "busybox.h"
15 15
16#define READLINK_FLAG_f (1 << 0) 16#define READLINK_FLAG_f (1 << 0)
17 17
@@ -33,7 +33,8 @@ int readlink_main(int argc, char **argv)
33 return EXIT_FAILURE; 33 return EXIT_FAILURE;
34 puts(buf); 34 puts(buf);
35 35
36 if (ENABLE_FEATURE_CLEAN_UP && buf != bb_common_bufsiz1) free(buf); 36 if (ENABLE_FEATURE_CLEAN_UP && buf != bb_common_bufsiz1)
37 free(buf);
37 38
38 return EXIT_SUCCESS; 39 return EXIT_SUCCESS;
39} 40}
diff --git a/debianutils/run_parts.c b/debianutils/run_parts.c
index 862db7a05..c54e515fe 100644
--- a/debianutils/run_parts.c
+++ b/debianutils/run_parts.c
@@ -10,21 +10,7 @@
10 * Copyright (C) 1996-1999 Guy Maor <maor@debian.org> 10 * Copyright (C) 1996-1999 Guy Maor <maor@debian.org>
11 * 11 *
12 * 12 *
13 * This program is free software; you can redistribute it and/or modify 13 * Licensed under GPL v2, see file LICENSE in this tarball for details.
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 * General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
26 * 02111-1307 USA
27 *
28 */ 14 */
29 15
30/* This is my first attempt to write a program in C (well, this is my first 16/* This is my first attempt to write a program in C (well, this is my first
@@ -49,10 +35,10 @@
49 * done - declare run_parts_main() as extern and any other function as static? 35 * done - declare run_parts_main() as extern and any other function as static?
50 */ 36 */
51 37
38#include "busybox.h"
52#include <getopt.h> 39#include <getopt.h>
53#include <stdlib.h> 40#include <stdlib.h>
54 41
55#include "busybox.h"
56 42
57static const struct option runparts_long_options[] = { 43static const struct option runparts_long_options[] = {
58 { "test", 0, NULL, 't' }, 44 { "test", 0, NULL, 't' },
diff --git a/debianutils/start_stop_daemon.c b/debianutils/start_stop_daemon.c
index 5c596c40a..b83a75994 100644
--- a/debianutils/start_stop_daemon.c
+++ b/debianutils/start_stop_daemon.c
@@ -7,6 +7,7 @@
7 * Adapted for busybox David Kimdon <dwhedon@gordian.com> 7 * Adapted for busybox David Kimdon <dwhedon@gordian.com>
8 */ 8 */
9 9
10#include "busybox.h"
10#include <stdio.h> 11#include <stdio.h>
11#include <stdlib.h> 12#include <stdlib.h>
12#include <string.h> 13#include <string.h>
@@ -17,8 +18,6 @@
17#include <dirent.h> 18#include <dirent.h>
18#include <unistd.h> 19#include <unistd.h>
19#include <getopt.h> /* struct option */ 20#include <getopt.h> /* struct option */
20
21#include "busybox.h"
22#include "pwd_.h" 21#include "pwd_.h"
23 22
24static int signal_nr = 15; 23static int signal_nr = 15;
diff --git a/debianutils/which.c b/debianutils/which.c
index 03b3c30f9..62cb1dc6d 100644
--- a/debianutils/which.c
+++ b/debianutils/which.c
@@ -9,12 +9,12 @@
9 * Based on which from debianutils 9 * Based on which from debianutils
10 */ 10 */
11 11
12#include "busybox.h"
12#include <string.h> 13#include <string.h>
13#include <stdio.h> 14#include <stdio.h>
14#include <stdlib.h> 15#include <stdlib.h>
15#include <unistd.h> 16#include <unistd.h>
16#include <sys/stat.h> 17#include <sys/stat.h>
17#include "busybox.h"
18 18
19int which_main(int argc, char **argv) 19int which_main(int argc, char **argv)
20{ 20{
diff --git a/docs/new-applet-HOWTO.txt b/docs/new-applet-HOWTO.txt
index 2f5702bd6..7acc80bb2 100644
--- a/docs/new-applet-HOWTO.txt
+++ b/docs/new-applet-HOWTO.txt
@@ -16,6 +16,8 @@ such as who you stole the code from and so forth. Also include the mini-GPL
16boilerplate. Be sure to name the main function <applet>_main instead of main. 16boilerplate. Be sure to name the main function <applet>_main instead of main.
17And be sure to put it in <applet>.c. Usage does not have to be taken care of by 17And be sure to put it in <applet>.c. Usage does not have to be taken care of by
18your applet. 18your applet.
19Make sure to #include "busybox.h" as the first include file in your applet so
20the bb_config.h and appropriate platform specific files are included properly.
19 21
20For a new applet mu, here is the code that would go in mu.c: 22For a new applet mu, here is the code that would go in mu.c:
21 23
@@ -25,13 +27,13 @@ For a new applet mu, here is the code that would go in mu.c:
25/* 27/*
26 * Mini mu implementation for busybox 28 * Mini mu implementation for busybox
27 * 29 *
28 *
29 * Copyright (C) [YEAR] by [YOUR NAME] <YOUR EMAIL> 30 * Copyright (C) [YEAR] by [YOUR NAME] <YOUR EMAIL>
30 * 31 *
31 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 32 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
32 */ 33 */
33 34
34#include "busybox.h" 35#include "busybox.h"
36#include <other.h>
35 37
36int mu_main(int argc, char **argv) 38int mu_main(int argc, char **argv)
37{ 39{
diff --git a/findutils/find.c b/findutils/find.c
index 17a1a5656..f8bcccaf5 100644
--- a/findutils/find.c
+++ b/findutils/find.c
@@ -7,22 +7,10 @@
7 * Reworked by David Douthitt <n9ubh@callsign.net> and 7 * Reworked by David Douthitt <n9ubh@callsign.net> and
8 * Matt Kraai <kraai@alumni.carnegiemellon.edu>. 8 * Matt Kraai <kraai@alumni.carnegiemellon.edu>.
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 */ 11 */
25 12
13#include "busybox.h"
26#include <stdio.h> 14#include <stdio.h>
27#include <unistd.h> 15#include <unistd.h>
28#include <dirent.h> 16#include <dirent.h>
@@ -31,7 +19,6 @@
31#include <fnmatch.h> 19#include <fnmatch.h>
32#include <time.h> 20#include <time.h>
33#include <ctype.h> 21#include <ctype.h>
34#include "busybox.h"
35 22
36//XXX just found out about libbb/messages.c . maybe move stuff there ? - ghoz 23//XXX just found out about libbb/messages.c . maybe move stuff there ? - ghoz
37static const char msg_req_arg[] = "option `%s' requires an argument"; 24static const char msg_req_arg[] = "option `%s' requires an argument";
diff --git a/findutils/grep.c b/findutils/grep.c
index fac296941..a24be248b 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -16,12 +16,12 @@
16 * precompiled regex 16 * precompiled regex
17*/ 17*/
18 18
19#include "busybox.h"
19#include <stdio.h> 20#include <stdio.h>
20#include <stdlib.h> 21#include <stdlib.h>
21#include <getopt.h> 22#include <getopt.h>
22#include <string.h> 23#include <string.h>
23#include <errno.h> 24#include <errno.h>
24#include "busybox.h"
25#include "xregex.h" 25#include "xregex.h"
26 26
27 27
diff --git a/findutils/xargs.c b/findutils/xargs.c
index ec6d99cac..c3a892695 100644
--- a/findutils/xargs.c
+++ b/findutils/xargs.c
@@ -1,3 +1,4 @@
1/* vi: set sw=4 ts=4: */
1/* 2/*
2 * Mini xargs implementation for busybox 3 * Mini xargs implementation for busybox
3 * Options are supported: "-prtx -n max_arg -s max_chars -e[ouf_str]" 4 * Options are supported: "-prtx -n max_arg -s max_chars -e[ouf_str]"
@@ -9,25 +10,14 @@
9 * - Mike Rendell <michael@cs.mun.ca> 10 * - Mike Rendell <michael@cs.mun.ca>
10 * and David MacKenzie <djm@gnu.ai.mit.edu>. 11 * and David MacKenzie <djm@gnu.ai.mit.edu>.
11 * 12 *
12 * This program is free software; you can redistribute it and/or modify 13 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 * General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 * 14 *
26 * xargs is described in the Single Unix Specification v3 at 15 * xargs is described in the Single Unix Specification v3 at
27 * http://www.opengroup.org/onlinepubs/007904975/utilities/xargs.html 16 * http://www.opengroup.org/onlinepubs/007904975/utilities/xargs.html
28 * 17 *
29 */ 18 */
30 19
20#include "busybox.h"
31#include <stdio.h> 21#include <stdio.h>
32#include <stdlib.h> 22#include <stdlib.h>
33#include <string.h> 23#include <string.h>
@@ -37,7 +27,6 @@
37#include <fcntl.h> 27#include <fcntl.h>
38#include <sys/types.h> 28#include <sys/types.h>
39#include <sys/wait.h> 29#include <sys/wait.h>
40#include "busybox.h"
41 30
42/* COMPAT: SYSV version defaults size (and has a max value of) to 470. 31/* COMPAT: SYSV version defaults size (and has a max value of) to 470.
43 We try to make it as large as possible. */ 32 We try to make it as large as possible. */
diff --git a/init/halt.c b/init/halt.c
index f3627f206..d1f561b63 100644
--- a/init/halt.c
+++ b/init/halt.c
@@ -7,10 +7,9 @@
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 */ 8 */
9 9
10#include "busybox.h"
10#include <signal.h> 11#include <signal.h>
11#include <sys/reboot.h> 12#include <sys/reboot.h>
12#include "busybox.h"
13
14#include <unistd.h> 13#include <unistd.h>
15 14
16int halt_main(int argc, char *argv[]) 15int halt_main(int argc, char *argv[])
@@ -40,7 +39,7 @@ RB_AUTOBOOT
40 flags = bb_getopt_ulflags(argc, argv, "d:nf", &delay); 39 flags = bb_getopt_ulflags(argc, argv, "d:nf", &delay);
41 if (flags&1) sleep(atoi(delay)); 40 if (flags&1) sleep(atoi(delay));
42 if (!(flags&2)) sync(); 41 if (!(flags&2)) sync();
43 42
44 /* Perform action. */ 43 /* Perform action. */
45 if (ENABLE_INIT && !(flags & 4)) { 44 if (ENABLE_INIT && !(flags & 4)) {
46 if (ENABLE_FEATURE_INITRD) { 45 if (ENABLE_FEATURE_INITRD) {
diff --git a/init/init_shared.c b/init/init_shared.c
index 722d57c6f..0abe72fdf 100644
--- a/init/init_shared.c
+++ b/init/init_shared.c
@@ -7,6 +7,7 @@
7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 */ 8 */
9 9
10#include "busybox.h"
10#include <signal.h> 11#include <signal.h>
11#include <stdlib.h> 12#include <stdlib.h>
12#include <sys/types.h> 13#include <sys/types.h>
@@ -14,7 +15,6 @@
14#include <getopt.h> 15#include <getopt.h>
15#include <sys/reboot.h> 16#include <sys/reboot.h>
16#include <sys/syslog.h> 17#include <sys/syslog.h>
17#include "busybox.h"
18#include "init_shared.h" 18#include "init_shared.h"
19 19
20const char * const init_sending_format = "Sending SIG%s to all processes."; 20const char * const init_sending_format = "Sending SIG%s to all processes.";
diff --git a/init/init_shared.h b/init/init_shared.h
index 0f3fe5b48..6df8de484 100644
--- a/init/init_shared.h
+++ b/init/init_shared.h
@@ -1,3 +1,9 @@
1/* vi: set sw=4 ts=4: */
2/*
3 * Helper functions shared by init et al.
4 *
5 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
6 */
1extern int kill_init(int sig); 7extern int kill_init(int sig);
2extern int bb_shutdown_system(unsigned long magic); 8extern int bb_shutdown_system(unsigned long magic);
3extern const char * const init_sending_format; 9extern const char * const init_sending_format;
diff --git a/init/mesg.c b/init/mesg.c
index 874c22089..7e47644c3 100644
--- a/init/mesg.c
+++ b/init/mesg.c
@@ -1,26 +1,15 @@
1/* vi: set sw=4 ts=4: */
1/* 2/*
2 * mesg implementation for busybox 3 * mesg implementation for busybox
3 * 4 *
4 * Copyright (c) 2002 Manuel Novoa III <mjn3@codepoet.org> 5 * Copyright (c) 2002 Manuel Novoa III <mjn3@codepoet.org>
5 * 6 *
6 * This program is free software; you can redistribute it and/or modify 7 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */ 8 */
20 9
10#include "busybox.h"
21#include <unistd.h> 11#include <unistd.h>
22#include <stdlib.h> 12#include <stdlib.h>
23#include "busybox.h"
24 13
25#ifdef USE_TTY_GROUP 14#ifdef USE_TTY_GROUP
26#define S_IWGRP_OR_S_IWOTH S_IWGRP 15#define S_IWGRP_OR_S_IWOTH S_IWGRP
diff --git a/procps/free.c b/procps/free.c
index b4163f108..7d8ffa893 100644
--- a/procps/free.c
+++ b/procps/free.c
@@ -4,28 +4,15 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */ 8 */
22 9
23/* getopt not needed */ 10/* getopt not needed */
24 11
12#include "busybox.h"
25#include <stdio.h> 13#include <stdio.h>
26#include <errno.h> 14#include <errno.h>
27#include <stdlib.h> 15#include <stdlib.h>
28#include "busybox.h"
29 16
30int free_main(int argc, char **argv) 17int free_main(int argc, char **argv)
31{ 18{
diff --git a/procps/fuser.c b/procps/fuser.c
index 35d77ed1c..1a4f612f1 100644
--- a/procps/fuser.c
+++ b/procps/fuser.c
@@ -1,3 +1,4 @@
1/* vi: set sw=4 ts=4: */
1/* 2/*
2 * tiny fuser implementation 3 * tiny fuser implementation
3 * 4 *
@@ -7,6 +8,7 @@
7 * GNU Library General Public License 8 * GNU Library General Public License
8 */ 9 */
9 10
11#include "busybox.h"
10#include <stdio.h> 12#include <stdio.h>
11#include <stdlib.h> 13#include <stdlib.h>
12#include <unistd.h> 14#include <unistd.h>
@@ -19,7 +21,6 @@
19#include <sys/stat.h> 21#include <sys/stat.h>
20#include <sys/socket.h> 22#include <sys/socket.h>
21#include <sys/sysmacros.h> 23#include <sys/sysmacros.h>
22#include "busybox.h"
23 24
24#define FUSER_PROC_DIR "/proc" 25#define FUSER_PROC_DIR "/proc"
25#define FUSER_MAX_LINE 255 26#define FUSER_MAX_LINE 255
diff --git a/procps/kill.c b/procps/kill.c
index 90114a493..ca6f4203a 100644
--- a/procps/kill.c
+++ b/procps/kill.c
@@ -5,23 +5,10 @@
5 * Copyright (C) 1995, 1996 by Bruce Perens <bruce@pixar.com>. 5 * Copyright (C) 1995, 1996 by Bruce Perens <bruce@pixar.com>.
6 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 6 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */ 9 */
23 10
24 11#include "busybox.h"
25#include <stdio.h> 12#include <stdio.h>
26#include <stdlib.h> 13#include <stdlib.h>
27#include <errno.h> 14#include <errno.h>
@@ -30,7 +17,6 @@
30#include <ctype.h> 17#include <ctype.h>
31#include <string.h> 18#include <string.h>
32#include <unistd.h> 19#include <unistd.h>
33#include "busybox.h"
34 20
35#define KILL 0 21#define KILL 0
36#define KILLALL 1 22#define KILLALL 1
diff --git a/procps/pidof.c b/procps/pidof.c
index 4ad6b1567..d9c8dca42 100644
--- a/procps/pidof.c
+++ b/procps/pidof.c
@@ -7,7 +7,7 @@
7 * Licensed under the GPL v2, see the file LICENSE in this tarball. 7 * Licensed under the GPL v2, see the file LICENSE in this tarball.
8 */ 8 */
9 9
10 10#include "busybox.h"
11#include <stdio.h> 11#include <stdio.h>
12#include <stdlib.h> 12#include <stdlib.h>
13#include <errno.h> 13#include <errno.h>
@@ -17,7 +17,6 @@
17#include <string.h> 17#include <string.h>
18#include <sys/types.h> 18#include <sys/types.h>
19#include <unistd.h> 19#include <unistd.h>
20#include "busybox.h"
21 20
22#if ENABLE_FEATURE_PIDOF_SINGLE 21#if ENABLE_FEATURE_PIDOF_SINGLE
23#define _SINGLE_COMPL(a) a 22#define _SINGLE_COMPL(a) a
diff --git a/procps/ps.c b/procps/ps.c
index b6242d208..9dc68395a 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -7,6 +7,7 @@
7 * Licensed under the GPL v2, see the file LICENSE in this tarball. 7 * Licensed under the GPL v2, see the file LICENSE in this tarball.
8 */ 8 */
9 9
10#include "busybox.h"
10#include <stdio.h> 11#include <stdio.h>
11#include <stdlib.h> 12#include <stdlib.h>
12#include <unistd.h> 13#include <unistd.h>
@@ -17,7 +18,6 @@
17#include <string.h> 18#include <string.h>
18#include <termios.h> 19#include <termios.h>
19#include <sys/ioctl.h> 20#include <sys/ioctl.h>
20#include "busybox.h"
21#if ENABLE_SELINUX 21#if ENABLE_SELINUX
22#include <selinux/selinux.h> /* for is_selinux_enabled() */ 22#include <selinux/selinux.h> /* for is_selinux_enabled() */
23#endif 23#endif
diff --git a/procps/renice.c b/procps/renice.c
index 711ed164e..53dc57855 100644
--- a/procps/renice.c
+++ b/procps/renice.c
@@ -4,20 +4,7 @@
4 * 4 *
5 * Copyright (C) 2005 Manuel Novoa III <mjn3@codepoet.org> 5 * Copyright (C) 2005 Manuel Novoa III <mjn3@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */ 8 */
22 9
23/* Notes: 10/* Notes:
@@ -32,6 +19,7 @@
32 * following IDs (if any). Multiple switches are allowed. 19 * following IDs (if any). Multiple switches are allowed.
33 */ 20 */
34 21
22#include "busybox.h"
35#include <stdio.h> 23#include <stdio.h>
36#include <stdlib.h> 24#include <stdlib.h>
37#include <string.h> 25#include <string.h>
@@ -39,7 +27,6 @@
39#include <errno.h> 27#include <errno.h>
40#include <unistd.h> 28#include <unistd.h>
41#include <sys/resource.h> 29#include <sys/resource.h>
42#include "busybox.h"
43 30
44#if (PRIO_PROCESS < CHAR_MIN) || (PRIO_PROCESS > CHAR_MAX) 31#if (PRIO_PROCESS < CHAR_MIN) || (PRIO_PROCESS > CHAR_MAX)
45#error Assumption violated : PRIO_PROCESS value 32#error Assumption violated : PRIO_PROCESS value
diff --git a/procps/sysctl.c b/procps/sysctl.c
index 125f13207..5673d293f 100644
--- a/procps/sysctl.c
+++ b/procps/sysctl.c
@@ -1,4 +1,4 @@
1 1/* vi: set sw=4 ts=4: */
2/* 2/*
3 * Sysctl 1.01 - A utility to read and manipulate the sysctl parameters 3 * Sysctl 1.01 - A utility to read and manipulate the sysctl parameters
4 * 4 *
@@ -14,6 +14,7 @@
14 * 14 *
15 */ 15 */
16 16
17#include "busybox.h"
17#include <stdio.h> 18#include <stdio.h>
18#include <stdlib.h> 19#include <stdlib.h>
19#include <unistd.h> 20#include <unistd.h>
@@ -23,7 +24,6 @@
23#include <string.h> 24#include <string.h>
24#include <errno.h> 25#include <errno.h>
25#include <fcntl.h> 26#include <fcntl.h>
26#include "busybox.h"
27 27
28/* 28/*
29 * Function Prototypes 29 * Function Prototypes
diff --git a/procps/top.c b/procps/top.c
index c0d16b658..a97e557aa 100644
--- a/procps/top.c
+++ b/procps/top.c
@@ -28,13 +28,13 @@
28 * GNU Library General Public License 28 * GNU Library General Public License
29 */ 29 */
30 30
31#include "busybox.h"
31#include <sys/types.h> 32#include <sys/types.h>
32#include <stdio.h> 33#include <stdio.h>
33#include <stdlib.h> 34#include <stdlib.h>
34#include <unistd.h> 35#include <unistd.h>
35#include <string.h> 36#include <string.h>
36#include <sys/ioctl.h> 37#include <sys/ioctl.h>
37#include "busybox.h"
38 38
39//#define CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE /* + 2k */ 39//#define CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE /* + 2k */
40 40
diff --git a/procps/uptime.c b/procps/uptime.c
index 7784850ae..c1e7af3a5 100644
--- a/procps/uptime.c
+++ b/procps/uptime.c
@@ -4,20 +4,7 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */ 8 */
22 9
23/* This version of uptime doesn't display the number of users on the system, 10/* This version of uptime doesn't display the number of users on the system,
@@ -28,12 +15,11 @@
28 15
29/* getopt not needed */ 16/* getopt not needed */
30 17
31 18#include "busybox.h"
32#include <stdio.h> 19#include <stdio.h>
33#include <time.h> 20#include <time.h>
34#include <errno.h> 21#include <errno.h>
35#include <stdlib.h> 22#include <stdlib.h>
36#include "busybox.h"
37 23
38#ifndef FSHIFT 24#ifndef FSHIFT
39# define FSHIFT 16 /* nr of bits of precision */ 25# define FSHIFT 16 /* nr of bits of precision */
diff --git a/shell/ash.c b/shell/ash.c
index c8ccf19b5..5cdd7f006 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -44,11 +44,12 @@
44 */ 44 */
45 45
46 46
47
48#define IFS_BROKEN 47#define IFS_BROKEN
49 48
50#define PROFILE 0 49#define PROFILE 0
51 50
51#include "busybox.h"
52
52#ifdef DEBUG 53#ifdef DEBUG
53#define _GNU_SOURCE 54#define _GNU_SOURCE
54#endif 55#endif
@@ -76,12 +77,10 @@
76#include <paths.h> 77#include <paths.h>
77#include <setjmp.h> 78#include <setjmp.h>
78#include <signal.h> 79#include <signal.h>
79#include <stdint.h> 80/*#include <stdint.h>*/
80#include <time.h> 81#include <time.h>
81#include <fnmatch.h> 82#include <fnmatch.h>
82 83
83
84#include "busybox.h"
85#include "pwd_.h" 84#include "pwd_.h"
86 85
87#ifdef CONFIG_ASH_JOB_CONTROL 86#ifdef CONFIG_ASH_JOB_CONTROL
diff --git a/shell/cmdedit.c b/shell/cmdedit.c
index d0e642250..8b5b2b942 100644
--- a/shell/cmdedit.c
+++ b/shell/cmdedit.c
@@ -31,6 +31,7 @@
31 */ 31 */
32 32
33 33
34#include "busybox.h"
34#include <stdio.h> 35#include <stdio.h>
35#include <errno.h> 36#include <errno.h>
36#include <unistd.h> 37#include <unistd.h>
@@ -41,8 +42,6 @@
41#include <signal.h> 42#include <signal.h>
42#include <limits.h> 43#include <limits.h>
43 44
44#include "busybox.h"
45
46#include "../shell/cmdedit.h" 45#include "../shell/cmdedit.h"
47 46
48 47
diff --git a/shell/hush.c b/shell/hush.c
index 0a46d125a..e3707380d 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -77,6 +77,8 @@
77 * 77 *
78 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. 78 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
79 */ 79 */
80
81#include "busybox.h"
80#include <ctype.h> /* isalpha, isdigit */ 82#include <ctype.h> /* isalpha, isdigit */
81#include <unistd.h> /* getpid */ 83#include <unistd.h> /* getpid */
82#include <stdlib.h> /* getenv, atoi */ 84#include <stdlib.h> /* getenv, atoi */
@@ -97,7 +99,6 @@
97/* #define DEBUG_SHELL */ 99/* #define DEBUG_SHELL */
98 100
99#if 1 101#if 1
100#include "busybox.h"
101#include "cmdedit.h" 102#include "cmdedit.h"
102#else 103#else
103#define bb_applet_name "hush" 104#define bb_applet_name "hush"
diff --git a/shell/lash.c b/shell/lash.c
index 8e8d45ae9..54408c97e 100644
--- a/shell/lash.c
+++ b/shell/lash.c
@@ -21,6 +21,7 @@
21//#define DEBUG_SHELL 21//#define DEBUG_SHELL
22 22
23 23
24#include "busybox.h"
24#include <stdio.h> 25#include <stdio.h>
25#include <stdlib.h> 26#include <stdlib.h>
26#include <ctype.h> 27#include <ctype.h>
@@ -33,7 +34,6 @@
33#include <unistd.h> 34#include <unistd.h>
34#include <getopt.h> 35#include <getopt.h>
35#include <termios.h> 36#include <termios.h>
36#include "busybox.h"
37#include "cmdedit.h" 37#include "cmdedit.h"
38 38
39#ifdef CONFIG_LOCALE_SUPPORT 39#ifdef CONFIG_LOCALE_SUPPORT
diff --git a/shell/msh.c b/shell/msh.c
index e47af795e..8bc769b6e 100644
--- a/shell/msh.c
+++ b/shell/msh.c
@@ -27,6 +27,7 @@
27 * Original copyright notice is retained at the end of this file. 27 * Original copyright notice is retained at the end of this file.
28 */ 28 */
29 29
30#include "busybox.h"
30#include <ctype.h> 31#include <ctype.h>
31#include <dirent.h> 32#include <dirent.h>
32#include <errno.h> 33#include <errno.h>
@@ -46,7 +47,6 @@
46#include <sys/wait.h> 47#include <sys/wait.h>
47 48
48#include "cmdedit.h" 49#include "cmdedit.h"
49#include "busybox.h"
50 50
51 51
52/* Conditional use of "register" keyword */ 52/* Conditional use of "register" keyword */
diff --git a/sysklogd/klogd.c b/sysklogd/klogd.c
index 404e2275d..92590d209 100644
--- a/sysklogd/klogd.c
+++ b/sysklogd/klogd.c
@@ -17,6 +17,7 @@
17 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. 17 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
18 */ 18 */
19 19
20#include "busybox.h"
20#include <stdio.h> 21#include <stdio.h>
21#include <stdlib.h> 22#include <stdlib.h>
22#include <signal.h> /* for our signal() handlers */ 23#include <signal.h> /* for our signal() handlers */
@@ -27,8 +28,6 @@
27#include <sys/syslog.h> 28#include <sys/syslog.h>
28#include <sys/klog.h> 29#include <sys/klog.h>
29 30
30#include "busybox.h"
31
32static void klogd_signal(int sig ATTRIBUTE_UNUSED) 31static void klogd_signal(int sig ATTRIBUTE_UNUSED)
33{ 32{
34 klogctl(7, NULL, 0); 33 klogctl(7, NULL, 0);
diff --git a/sysklogd/logger.c b/sysklogd/logger.c
index 0c6fb0845..ea093ed52 100644
--- a/sysklogd/logger.c
+++ b/sysklogd/logger.c
@@ -4,22 +4,10 @@
4 * 4 *
5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 *
21 */ 8 */
22 9
10#include "busybox.h"
23#include <stdio.h> 11#include <stdio.h>
24#include <unistd.h> 12#include <unistd.h>
25#include <sys/types.h> 13#include <sys/types.h>
@@ -28,7 +16,6 @@
28#include <string.h> 16#include <string.h>
29#include <stdlib.h> 17#include <stdlib.h>
30 18
31#include "busybox.h"
32#if !defined CONFIG_SYSLOGD 19#if !defined CONFIG_SYSLOGD
33 20
34#define SYSLOG_NAMES 21#define SYSLOG_NAMES
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c
index 2e2681b67..dfff75728 100644
--- a/sysklogd/syslogd.c
+++ b/sysklogd/syslogd.c
@@ -13,6 +13,7 @@
13 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. 13 * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
14 */ 14 */
15 15
16#include "busybox.h"
16#include <stdio.h> 17#include <stdio.h>
17#include <stdlib.h> 18#include <stdlib.h>
18#include <ctype.h> 19#include <ctype.h>
@@ -32,8 +33,6 @@
32#include <sys/un.h> 33#include <sys/un.h>
33#include <sys/param.h> 34#include <sys/param.h>
34 35
35#include "busybox.h"
36
37/* SYSLOG_NAMES defined to pull some extra junk from syslog.h */ 36/* SYSLOG_NAMES defined to pull some extra junk from syslog.h */
38#define SYSLOG_NAMES 37#define SYSLOG_NAMES
39#include <sys/syslog.h> 38#include <sys/syslog.h>