diff options
author | Michael Meissner <gnu@the-meissners.org> | 2000-11-22 18:26:10 +0000 |
---|---|---|
committer | Michael Meissner <gnu@the-meissners.org> | 2000-11-22 18:26:10 +0000 |
commit | 73dea7905cb5fea2540256bacdfde33fe0ad1a0b (patch) | |
tree | 1dd1d4630bf2e207f204657c23319050dbf67c9c /newlib/libc/posix/execv.c | |
parent | 0217c5bb3b85854cea392d7299706348dc007ae8 (diff) | |
download | cygnal-73dea7905cb5fea2540256bacdfde33fe0ad1a0b.tar.gz cygnal-73dea7905cb5fea2540256bacdfde33fe0ad1a0b.tar.bz2 cygnal-73dea7905cb5fea2540256bacdfde33fe0ad1a0b.zip |
Only reference environ indirectly through a pointer
Diffstat (limited to 'newlib/libc/posix/execv.c')
-rw-r--r-- | newlib/libc/posix/execv.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/newlib/libc/posix/execv.c b/newlib/libc/posix/execv.c index 42a78cb52..5effb9c57 100644 --- a/newlib/libc/posix/execv.c +++ b/newlib/libc/posix/execv.c @@ -6,10 +6,15 @@ #include <_ansi.h> #include <unistd.h> +/* Only deal with a pointer to environ, to work around subtle bugs with shared + libraries and/or small data systems where the user declares his own + 'environ'. */ +static char ***p_environ = &environ; + int _DEFUN (execv, (path, argv), const char *path _AND char * const argv[]) { - return _execve (path, (char * _CONST *) argv, environ); + return _execve (path, (char * _CONST *) argv, *p_environ); } |