Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-04-30 21:07:05 +0400
committerChristopher Faylor <me@cgf.cx>2005-04-30 21:07:05 +0400
commitf0b14f146e02256b3f99d997194e9cdbba85acb5 (patch)
tree11a2311f660fb61b54476ece73202233bfd7c3c7 /winsup
parent06e0dc9a4672966742410aae4967f3c7bfa5188c (diff)
* 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.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog11
-rw-r--r--winsup/cygwin/environ.cc14
-rw-r--r--winsup/cygwin/shared.cc5
3 files changed, 22 insertions, 8 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 803306aa2..0e687757f 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,16 @@
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.
2005-04-29 Christopher Faylor <cgf@timesys.com>
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index 75c1a8139..51ed344d1 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -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;
diff --git a/winsup/cygwin/shared.cc b/winsup/cygwin/shared.cc
index f0daccb85..dcb26a9af 100644
--- a/winsup/cygwin/shared.cc
+++ b/winsup/cygwin/shared.cc
@@ -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;