From: Roland McGrath Date: Mon, 3 Apr 2000 17:13:21 +0000 (+0000) Subject: 2000-04-03 Roland McGrath X-Git-Tag: cvs/glibc_2-1-91~716 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9129b9874db71c9325ee0772810fee8a5e4a82f8;p=platform%2Fupstream%2Fglibc.git 2000-04-03 Roland McGrath * 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. --- diff --git a/sysdeps/mach/hurd/i386/init-first.c b/sysdeps/mach/hurd/i386/init-first.c index 505c9ca..b26a9da 100644 --- a/sysdeps/mach/hurd/i386/init-first.c +++ b/sysdeps/mach/hurd/i386/init-first.c @@ -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;