aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-01-28 22:45:43 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-01-28 22:45:43 +0000
commit847fa779aff2592e842654b95dc2c321885e1eec (patch)
tree82a3ba374faa6f07bdcfea80d12a6e9efe2870c4 /shell
parent0effc2410b219de8c1966752ed217d67943fce69 (diff)
downloadbusybox-847fa779aff2592e842654b95dc2c321885e1eec.tar.gz
*: tidy up usage of char **environ
Diffstat (limited to 'shell')
-rw-r--r--shell/ash.c1
-rw-r--r--shell/hush.c2
-rw-r--r--shell/msh.c10
3 files changed, 6 insertions, 7 deletions
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 @@
#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"
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 @@
#include <getopt.h> /* should be pretty obvious */
/* #include <dmalloc.h> */
-extern char **environ; /* This is in <unistd.h>, but protected with __USE_GNU */
-
#include "busybox.h" /* for APPLET_IS_NOFORK/NOEXEC */
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)
}
#else
# include "busybox.h" /* for applet_names */
-extern char **environ;
#endif
/*#define MSHDEBUG 1*/
@@ -2825,11 +2824,13 @@ static int forkexec(struct op *t, int *pin, int *pout, int act, char **wp)
if (pin != NULL) {
xmove_fd(pin[0], 0);
- if (pin[1] != 0) close(pin[1]);
+ if (pin[1] != 0)
+ close(pin[1]);
}
if (pout != NULL) {
xmove_fd(pout[1], 1);
- if (pout[1] != 1) close(pout[0]);
+ if (pout[1] != 1)
+ close(pout[0]);
}
iopp = t->ioact;
@@ -4181,7 +4182,8 @@ static int grave(int quoted)
* echo "$files" >zz
*/
xmove_fd(pf[1], 1);
- if (pf[0] != 1) close(pf[0]);
+ if (pf[0] != 1)
+ close(pf[0]);
argument_list[0] = (char *) DEFAULT_SHELL;
argument_list[1] = (char *) "-c";