diff options
author | Christopher Faylor <me@cgf.cx> | 2000-07-15 02:48:11 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-07-15 02:48:11 +0000 |
commit | 2eb392bd77de1535823daeae04c83fae0e331ee8 (patch) | |
tree | 4884c02f41340bb1267f1566f004e76a90599d4e /winsup/cygwin/lib | |
parent | 44d2afed74351bafed8c4f4d4e5664e50a9c9a9c (diff) | |
download | newlib-2eb392bd77de1535823daeae04c83fae0e331ee8.zip newlib-2eb392bd77de1535823daeae04c83fae0e331ee8.tar.gz newlib-2eb392bd77de1535823daeae04c83fae0e331ee8.tar.bz2 |
* hinfo.cc (hinfo::linearize_fd_array): Make max_used_fd an int so that we can
detect when there are no fds to pass.
* dcrt0.cc (host_dependent_constants::init): Revert Sat Mar 18 01:32:04 2000
change.
(dll_crt0_1): Set "cygwin_finished_initializing" flag.
(dll_crt0): Don't perform memcpy if uptr is already set to internal structure.
(_dll_crt0): Remember location of programs envptr.
* dll_init.h (per_module, dll, dll_list): Revamp.
* dll_init.cc: Revamp. Use new classes.
* fork.cc (fork): Use new revamped dll, dll_list, and per_module stuff.
* environ.cc: Use __cygwin_environ throughout rather than the
user_data->envptr.
* exec.cc: Ditto.
* spawn.cc: Ditto.
* winsup.h: Declare update_envptrs, cygwin_finished_initializing.
* lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Revert previous change.
* lib/cygwin_attach_dll.cc (cygwin_attach_dll): Always pass in own per_process
structure or we end up overwriting information from the main program.
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); } |