diff options
-rw-r--r-- | archival/libunarchive/open_transformer.c | 2 | ||||
-rw-r--r-- | coreutils/env.c | 2 | ||||
-rw-r--r-- | coreutils/printenv.c | 1 | ||||
-rw-r--r-- | editors/awk.c | 1 | ||||
-rw-r--r-- | include/libbb.h | 3 | ||||
-rw-r--r-- | networking/inetd.c | 3 | ||||
-rw-r--r-- | runit/runsv.c | 2 | ||||
-rw-r--r-- | runit/svlogd.c | 2 | ||||
-rw-r--r-- | shell/ash.c | 1 | ||||
-rw-r--r-- | shell/hush.c | 2 | ||||
-rw-r--r-- | shell/msh.c | 10 |
11 files changed, 12 insertions, 17 deletions
diff --git a/archival/libunarchive/open_transformer.c b/archival/libunarchive/open_transformer.c index 757a2a389..d6f5e6271 100644 --- a/archival/libunarchive/open_transformer.c +++ b/archival/libunarchive/open_transformer.c | |||
@@ -30,7 +30,7 @@ int open_transformer(int src_fd, | |||
30 | 30 | ||
31 | if (pid == 0) { | 31 | if (pid == 0) { |
32 | /* child process */ | 32 | /* child process */ |
33 | close(fd_pipe[0]); /* We don't wan't to read from the parent */ | 33 | close(fd_pipe[0]); /* We don't want to read from the parent */ |
34 | // FIXME: error check? | 34 | // FIXME: error check? |
35 | #if BB_MMU | 35 | #if BB_MMU |
36 | transformer(src_fd, fd_pipe[1]); | 36 | transformer(src_fd, fd_pipe[1]); |
diff --git a/coreutils/env.c b/coreutils/env.c index b45cbcc7d..7273d39fc 100644 --- a/coreutils/env.c +++ b/coreutils/env.c | |||
@@ -30,8 +30,6 @@ | |||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #include <getopt.h> /* struct option */ | 32 | #include <getopt.h> /* struct option */ |
33 | extern char **environ; | ||
34 | |||
35 | #include "libbb.h" | 33 | #include "libbb.h" |
36 | 34 | ||
37 | #if ENABLE_FEATURE_ENV_LONG_OPTIONS | 35 | #if ENABLE_FEATURE_ENV_LONG_OPTIONS |
diff --git a/coreutils/printenv.c b/coreutils/printenv.c index bac77e2a8..06d68d0ef 100644 --- a/coreutils/printenv.c +++ b/coreutils/printenv.c | |||
@@ -9,7 +9,6 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include "libbb.h" | 11 | #include "libbb.h" |
12 | extern char **environ; | ||
13 | 12 | ||
14 | int printenv_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; | 13 | int printenv_main(int argc, char **argv) MAIN_EXTERNALLY_VISIBLE; |
15 | int printenv_main(int argc, char **argv) | 14 | int printenv_main(int argc, char **argv) |
diff --git a/editors/awk.c b/editors/awk.c index da3401b37..983b31116 100644 --- a/editors/awk.c +++ b/editors/awk.c | |||
@@ -10,7 +10,6 @@ | |||
10 | #include "libbb.h" | 10 | #include "libbb.h" |
11 | #include "xregex.h" | 11 | #include "xregex.h" |
12 | #include <math.h> | 12 | #include <math.h> |
13 | extern char **environ; | ||
14 | 13 | ||
15 | /* This is a NOEXEC applet. Be very careful! */ | 14 | /* This is a NOEXEC applet. Be very careful! */ |
16 | 15 | ||
diff --git a/include/libbb.h b/include/libbb.h index 9d70e7099..c5b685985 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
@@ -67,6 +67,9 @@ | |||
67 | #include "shadow_.h" | 67 | #include "shadow_.h" |
68 | #endif | 68 | #endif |
69 | 69 | ||
70 | /* Some libc's don't declare it, help them */ | ||
71 | extern char **environ; | ||
72 | |||
70 | #if defined(__GLIBC__) && __GLIBC__ < 2 | 73 | #if defined(__GLIBC__) && __GLIBC__ < 2 |
71 | int vdprintf(int d, const char *format, va_list ap); | 74 | int vdprintf(int d, const char *format, va_list ap); |
72 | #endif | 75 | #endif |
diff --git a/networking/inetd.c b/networking/inetd.c index d643dc6e0..a7259f3d4 100644 --- a/networking/inetd.c +++ b/networking/inetd.c | |||
@@ -172,9 +172,6 @@ | |||
172 | #include <rpc/pmap_clnt.h> | 172 | #include <rpc/pmap_clnt.h> |
173 | #endif | 173 | #endif |
174 | 174 | ||
175 | extern char **environ; | ||
176 | |||
177 | |||
178 | #define _PATH_INETDPID "/var/run/inetd.pid" | 175 | #define _PATH_INETDPID "/var/run/inetd.pid" |
179 | 176 | ||
180 | #define CNT_INTVL 60 /* servers in CNT_INTVL sec. */ | 177 | #define CNT_INTVL 60 /* servers in CNT_INTVL sec. */ |
diff --git a/runit/runsv.c b/runit/runsv.c index 84f5193f5..e9a074580 100644 --- a/runit/runsv.c +++ b/runit/runsv.c | |||
@@ -279,7 +279,7 @@ static unsigned custom(struct svdir *s, char c) | |||
279 | warn_cannot("setup stdout for control/?"); | 279 | warn_cannot("setup stdout for control/?"); |
280 | prog[0] = a; | 280 | prog[0] = a; |
281 | prog[1] = NULL; | 281 | prog[1] = NULL; |
282 | execve(a, prog, environ); | 282 | execv(a, prog); |
283 | fatal_cannot("run control/?"); | 283 | fatal_cannot("run control/?"); |
284 | } | 284 | } |
285 | while (safe_waitpid(pid, &w, 0) == -1) { | 285 | while (safe_waitpid(pid, &w, 0) == -1) { |
diff --git a/runit/svlogd.c b/runit/svlogd.c index 1d679c972..9c169da1f 100644 --- a/runit/svlogd.c +++ b/runit/svlogd.c | |||
@@ -252,7 +252,7 @@ static unsigned processorstart(struct logdir *ld) | |||
252 | prog[1] = (char*)"-c"; | 252 | prog[1] = (char*)"-c"; |
253 | prog[2] = ld->processor; | 253 | prog[2] = ld->processor; |
254 | prog[3] = NULL; | 254 | prog[3] = NULL; |
255 | execve("/bin/sh", prog, environ); | 255 | execv("/bin/sh", prog); |
256 | bb_perror_msg_and_die(FATAL"cannot %s processor %s", "run", ld->name); | 256 | bb_perror_msg_and_die(FATAL"cannot %s processor %s", "run", ld->name); |
257 | } | 257 | } |
258 | ld->ppid = pid; | 258 | ld->ppid = pid; |
diff --git a/shell/ash.c b/shell/ash.c index 96563bf06..2a9e96a35 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -60,7 +60,6 @@ | |||
60 | #if JOBS || ENABLE_ASH_READ_NCHARS | 60 | #if JOBS || ENABLE_ASH_READ_NCHARS |
61 | #include <termios.h> | 61 | #include <termios.h> |
62 | #endif | 62 | #endif |
63 | extern char **environ; | ||
64 | 63 | ||
65 | #if defined(__uClinux__) | 64 | #if defined(__uClinux__) |
66 | #error "Do not even bother, ash will not run on uClinux" | 65 | #error "Do not even bother, ash will not run on uClinux" |
diff --git a/shell/hush.c b/shell/hush.c index 9dc85d0ba..a75407634 100644 --- a/shell/hush.c +++ b/shell/hush.c | |||
@@ -81,8 +81,6 @@ | |||
81 | #include <getopt.h> /* should be pretty obvious */ | 81 | #include <getopt.h> /* should be pretty obvious */ |
82 | /* #include <dmalloc.h> */ | 82 | /* #include <dmalloc.h> */ |
83 | 83 | ||
84 | extern char **environ; /* This is in <unistd.h>, but protected with __USE_GNU */ | ||
85 | |||
86 | #include "busybox.h" /* for APPLET_IS_NOFORK/NOEXEC */ | 84 | #include "busybox.h" /* for APPLET_IS_NOFORK/NOEXEC */ |
87 | 85 | ||
88 | 86 | ||
diff --git a/shell/msh.c b/shell/msh.c index 9e9b798a1..7371120ca 100644 --- a/shell/msh.c +++ b/shell/msh.c | |||
@@ -84,7 +84,6 @@ static char *itoa(int n) | |||
84 | } | 84 | } |
85 | #else | 85 | #else |
86 | # include "busybox.h" /* for applet_names */ | 86 | # include "busybox.h" /* for applet_names */ |
87 | extern char **environ; | ||
88 | #endif | 87 | #endif |
89 | 88 | ||
90 | /*#define MSHDEBUG 1*/ | 89 | /*#define MSHDEBUG 1*/ |
@@ -2825,11 +2824,13 @@ static int forkexec(struct op *t, int *pin, int *pout, int act, char **wp) | |||
2825 | 2824 | ||
2826 | if (pin != NULL) { | 2825 | if (pin != NULL) { |
2827 | xmove_fd(pin[0], 0); | 2826 | xmove_fd(pin[0], 0); |
2828 | if (pin[1] != 0) close(pin[1]); | 2827 | if (pin[1] != 0) |
2828 | close(pin[1]); | ||
2829 | } | 2829 | } |
2830 | if (pout != NULL) { | 2830 | if (pout != NULL) { |
2831 | xmove_fd(pout[1], 1); | 2831 | xmove_fd(pout[1], 1); |
2832 | if (pout[1] != 1) close(pout[0]); | 2832 | if (pout[1] != 1) |
2833 | close(pout[0]); | ||
2833 | } | 2834 | } |
2834 | 2835 | ||
2835 | iopp = t->ioact; | 2836 | iopp = t->ioact; |
@@ -4181,7 +4182,8 @@ static int grave(int quoted) | |||
4181 | * echo "$files" >zz | 4182 | * echo "$files" >zz |
4182 | */ | 4183 | */ |
4183 | xmove_fd(pf[1], 1); | 4184 | xmove_fd(pf[1], 1); |
4184 | if (pf[0] != 1) close(pf[0]); | 4185 | if (pf[0] != 1) |
4186 | close(pf[0]); | ||
4185 | 4187 | ||
4186 | argument_list[0] = (char *) DEFAULT_SHELL; | 4188 | argument_list[0] = (char *) DEFAULT_SHELL; |
4187 | argument_list[1] = (char *) "-c"; | 4189 | argument_list[1] = (char *) "-c"; |