2000-04-03 Roland McGrath <roland@baalperazim.frob.com>

* sysdeps/mach/hurd/i386/init-first.c (init): Don't set __environ
	here, before we might move the stack.
	(posixland_init): Set __libc_argc, __libc_argc, and __environ here.
	(init1): And not here.
This commit is contained in:
Roland McGrath 2000-04-03 17:13:21 +00:00
parent 152e7964d6
commit 9129b9874d
1 changed files with 7 additions and 7 deletions

View File

@ -56,12 +56,16 @@ DEFINE_HOOK (_hurd_preinit_hook, (void));
static void
posixland_init (int argc, char **argv, char **envp)
{
__libc_init (argc, argv, __environ);
__libc_argc = argc;
__libc_argv = argv;
__environ = envp;
__libc_init (argc, argv, envp);
/* This is a hack to make the special getopt in GNU libc working. */
__getopt_clean_environment (__environ);
__getopt_clean_environment (envp);
#ifdef PIC
#ifdef SHARED
__libc_global_ctors ();
#endif
}
@ -74,9 +78,6 @@ init1 (int argc, char *arg0, ...)
char **envp = &argv[argc + 1];
struct hurd_startup_data *d;
__libc_argc = argc;
__libc_argv = argv;
while (*envp)
++envp;
d = (void *) ++envp;
@ -131,7 +132,6 @@ init (int *data)
memset (threadvars, 0, sizeof threadvars);
__hurd_threadvar_stack_offset = (unsigned long int) threadvars;
__environ = envp;
while (*envp)
++envp;
d = (void *) ++envp;