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-w32-847fa779aff2592e842654b95dc2c321885e1eec.tar.gz
busybox-w32-847fa779aff2592e842654b95dc2c321885e1eec.tar.bz2
busybox-w32-847fa779aff2592e842654b95dc2c321885e1eec.zip
*: 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 @@
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
63extern 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
84extern 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 */
87extern 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";