* 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.
This commit is contained in:
Christopher Faylor
2000-07-15 02:48:11 +00:00
parent 44d2afed74
commit 2eb392bd77
13 changed files with 427 additions and 496 deletions

View File

@@ -13,7 +13,7 @@ details. */
#include <ctype.h>
#include <fcntl.h>
#define environ (*user_data->envptr)
#define environ __cygwin_environ
extern BOOL allow_glob;
extern BOOL allow_ntea;
@@ -228,11 +228,12 @@ setenv (const char *name, const char *value, int rewrite)
for (P = environ, cnt = 0; *P; ++P, ++cnt)
;
__cygwin_environ = environ = (char **) realloc ((char *) environ,
(size_t) (sizeof (char *) * (cnt + 2)));
environ = (char **) realloc ((char *) environ,
(size_t) (sizeof (char *) * (cnt + 2)));
if (!environ)
return -1;
environ[cnt + 1] = NULL;
update_envptrs ();
offset = cnt;
}
@@ -502,7 +503,8 @@ environ_init (int already_posix)
if (!sawTERM)
envp[i++] = strdup ("TERM=cygwin");
envp[i] = NULL;
__cygwin_environ = environ = envp;
environ = envp;
update_envptrs ();
FreeEnvironmentStringsA ((char *) rawenv);
parse_options (NULL);
MALLOC_CHECK;