several *.c files:
authorDenis Vlasenko <vda.linux@googlemail.com>
Thu, 17 May 2007 23:02:14 +0000 (23:02 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Thu, 17 May 2007 23:02:14 +0000 (23:02 -0000)
move 'extern environ' up to the location of #includes

coreutils/env.c
coreutils/printenv.c
editors/awk.c
networking/inetd.c
shell/ash.c

index f47d450c5fcc6785d4b01c45d6c9cd8af75ab169..2a271f7032f760b5aa99f97a3be98f7e2c562661 100644 (file)
@@ -32,6 +32,7 @@
 #include "busybox.h"
 #include <errno.h>
 #include <getopt.h> /* struct option */
+extern char **environ;
 
 #if ENABLE_FEATURE_ENV_LONG_OPTIONS
 static const struct option env_long_options[] = {
@@ -49,7 +50,6 @@ int env_main(int argc, char** argv)
        char **ep;
        unsigned opt;
        llist_t *unset_env = NULL;
-       extern char **environ;
 
        opt_complementary = "u::";
 #if ENABLE_FEATURE_ENV_LONG_OPTIONS
index 1d41eeb7b1301c5b8d068594679d871a74b2680d..935f52df3ffa9402be34c0145e435f33c9d2ff3c 100644 (file)
 #include <string.h>
 #include <stdlib.h>
 #include "busybox.h"
+extern char **environ;
 
 int printenv_main(int argc, char **argv);
 int printenv_main(int argc, char **argv)
 {
-       extern char **environ;
        int e = 0;
 
        /* no variables specified, show whole env */
index 9366a239851a5d7a2aa84814ed5bd7612a6bb976..76ebe0fb90ca26b1ef68a1399ceabe76427529e6 100644 (file)
@@ -10,6 +10,7 @@
 #include "busybox.h"
 #include "xregex.h"
 #include <math.h>
+extern char **environ;
 
 /* This is a NOEXEC applet. Be very careful! */
 
@@ -393,8 +394,6 @@ enum { NPRIMES = sizeof(PRIMES) / sizeof(unsigned) };
 
 /* globals */
 
-extern char **environ;
-
 static var * V[_intvarcount_];
 static chain beginseq, mainseq, endseq, *seq;
 static int nextrec, nextfile;
index 0ba3b949a2ef8f361c956fb0c82dc664dfe11118..dc191a40eb0ee8e5c14726457403ca689bf86ef5 100644 (file)
 #include <rpc/pmap_clnt.h>
 #endif
 
-#define _PATH_INETDPID  "/var/run/inetd.pid"
+extern char **environ;
+
 
+#define _PATH_INETDPID  "/var/run/inetd.pid"
 
 #define CNT_INTVL       60              /* servers in CNT_INTVL sec. */
 #define RETRYTIME       (60*10)         /* retry after bind or server fail */
@@ -1263,7 +1265,6 @@ int inetd_main(int argc, char **argv)
        sigset_t omask, wait_mask;
 
 #ifdef INETD_SETPROCTITLE
-       extern char **environ;
        char **envp = environ;
 
        Argv = argv;
index 4b37f403c73c171b4c9914d270f644b5d078e674..4417ee9086f815372de33aab43122b3bac5ceeb2 100644 (file)
@@ -60,6 +60,7 @@
 #if JOBS || ENABLE_ASH_READ_NCHARS
 #include <termios.h>
 #endif
+extern char **environ;
 
 #if defined(__uClinux__)
 #error "Do not even bother, ash will not run on uClinux"
@@ -1747,7 +1748,6 @@ struct redirtab {
 
 static struct redirtab *redirlist;
 static int nullredirs;
-extern char **environ;
 static int preverrout_fd;   /* save fd2 before print debug if xflag is set. */
 
 #define VTABSIZE 39