* environ.cc (spenv::force_into_environment): Rename from add_always.
(spenv::add_if_exists): Rename from force. (build_env): Accommodate name changes. Make sure that stuff that is always supposed to be in the environment is actually added to the environment. * shared.cc (open_shared): Restore VirtualFree eliminated by 2005-04-28 change.
This commit is contained in:
parent
06e0dc9a46
commit
f0b14f146e
|
@ -1,3 +1,14 @@
|
|||
2005-04-30 Christopher Faylor <cgf@timesys.com>
|
||||
|
||||
* environ.cc (spenv::force_into_environment): Rename from add_always.
|
||||
(spenv::add_if_exists): Rename from force.
|
||||
(build_env): Accommodate name changes. Make sure that stuff that is
|
||||
always supposed to be in the environment is actually added to the
|
||||
environment.
|
||||
|
||||
* shared.cc (open_shared): Restore VirtualFree eliminated by 2005-04-28
|
||||
change.
|
||||
|
||||
2005-04-30 Christopher Faylor <cgf@timesys.com>
|
||||
|
||||
* errno.cc (errmap): Sort table.
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/* environ.cc: Cygwin-adopted functions from newlib to manipulate
|
||||
process's environment.
|
||||
|
||||
Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005 Red Hat, Inc.
|
||||
Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Red Hat, Inc.
|
||||
|
||||
This software is a copyrighted work licensed under the terms of the
|
||||
Cygwin license. Please consult the file "CYGWIN_LICENSE" for
|
||||
|
@ -854,8 +854,8 @@ struct spenv
|
|||
{
|
||||
const char *name;
|
||||
size_t namelen;
|
||||
bool add_always; /* If true, always add to env if missing */
|
||||
bool force; /* if true, retrieve value from cache */
|
||||
bool force_into_environmentironment; /* If true, always add to env if missing */
|
||||
bool add_if_exists; /* if true, retrieve value from cache */
|
||||
const char * (cygheap_user::*from_cygheap) (const char *, size_t);
|
||||
|
||||
char *retrieve (bool, const char * const = NULL)
|
||||
|
@ -953,7 +953,7 @@ build_env (const char * const *envp, char *&envblock, int &envc,
|
|||
saw_spenv[i] = 1;
|
||||
if (*dstp == env_dontadd)
|
||||
goto next1;
|
||||
if (spenvs[i].force)
|
||||
if (spenvs[i].add_if_exists)
|
||||
calc_tl = true;
|
||||
goto next0;
|
||||
}
|
||||
|
@ -975,10 +975,10 @@ build_env (const char * const *envp, char *&envblock, int &envc,
|
|||
assert ((srcp - envp) == n);
|
||||
/* Fill in any required-but-missing environment variables. */
|
||||
for (unsigned i = 0; i < SPENVS_SIZE; i++)
|
||||
if (!saw_spenv[i] && (spenvs[i].add_always || cygheap->user.issetuid ()))
|
||||
if (!saw_spenv[i] && (spenvs[i].force_into_environmentironment || cygheap->user.issetuid ()))
|
||||
{
|
||||
*dstp = spenvs[i].retrieve (no_envblock);
|
||||
if (*dstp && (!no_envblock || spenvs[i].force) && *dstp != env_dontadd)
|
||||
*dstp = spenvs[i].retrieve (false);
|
||||
if (*dstp && *dstp != env_dontadd)
|
||||
{
|
||||
*pass_dstp++ = *dstp;
|
||||
tl += strlen (*dstp) + 1;
|
||||
|
|
|
@ -84,7 +84,10 @@ open_shared (const char *name, int n, HANDLE& shared_h, DWORD size,
|
|||
|| !wincap.needs_memory_protection () && offsets[0])
|
||||
addr = NULL;
|
||||
else
|
||||
addr = offsets[m];
|
||||
{
|
||||
addr = offsets[m];
|
||||
(void) VirtualFree (addr, 0, MEM_RELEASE);
|
||||
}
|
||||
|
||||
if (shared_h)
|
||||
m = SH_JUSTOPEN;
|
||||
|
|
Loading…
Reference in New Issue