diff options
Diffstat (limited to 'winsup/cygwin/lib')
-rw-r--r-- | winsup/cygwin/lib/_cygwin_crt0_common.cc | 5 | ||||
-rw-r--r-- | winsup/cygwin/lib/cygwin_attach_dll.c | 12 |
2 files changed, 4 insertions, 13 deletions
diff --git a/winsup/cygwin/lib/_cygwin_crt0_common.cc b/winsup/cygwin/lib/_cygwin_crt0_common.cc index fcca169..4ca6dd7 100644 --- a/winsup/cygwin/lib/_cygwin_crt0_common.cc +++ b/winsup/cygwin/lib/_cygwin_crt0_common.cc @@ -56,10 +56,7 @@ _cygwin_crt0_common (MainFunc f, per_process *u) u->ctors = &__CTOR_LIST__; u->dtors = &__DTOR_LIST__; - if (!u->envptr) - u->envptr = &environ; - else - environ = *(u->envptr); + u->envptr = &environ; if (uwasnull) _impure_ptr = u->impure_ptr; /* Use field initialized in newer DLLs. */ else diff --git a/winsup/cygwin/lib/cygwin_attach_dll.c b/winsup/cygwin/lib/cygwin_attach_dll.c index 09b898b..440cace 100644 --- a/winsup/cygwin/lib/cygwin_attach_dll.c +++ b/winsup/cygwin/lib/cygwin_attach_dll.c @@ -17,15 +17,9 @@ details. */ int cygwin_attach_dll (HMODULE h, MainFunc f) { - struct per_process *u; - if (_cygwin_crt0_common (f, NULL)) - u = NULL; /* Newer DLL. Use DLL internal per_process. */ - else /* Older DLL. Provide a per_process */ - { - u = (struct per_process *) alloca (sizeof (*u)); - (void) _cygwin_crt0_common (f, u); - } + struct per_process u; + (void) _cygwin_crt0_common (f, &u); /* jump into the dll. */ - return dll_dllcrt0 (h, u); + return dll_dllcrt0 (h, &u); } |