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
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-06-19 19:27:27 +0400
committerChristopher Faylor <me@cgf.cx>2002-06-19 19:27:27 +0400
commit03a2ce9a3623dddc5ff7db9a3c18e2eb359e4afe (patch)
treeb19c8c77cda62398c18f8b127a7347096f0af86e /winsup/cygwin/environ.cc
parent834224ab85c94d4764d67670a880484ce0785a62 (diff)
Use hMainProc where appropriate, throughout.
* environ.cc (spenv::retrieve): Add debugging statements. * pinfo.cc (set_myself): Don't call strace.hello if already stracing. * strace.cc (strace): Move NO_COPY keyword so that it will actually take effect.
Diffstat (limited to 'winsup/cygwin/environ.cc')
-rw-r--r--winsup/cygwin/environ.cc41
1 files changed, 29 insertions, 12 deletions
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index 12ae6e76f..1b3ff4f28 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -58,16 +58,16 @@ static NO_COPY win_env conv_envvars[] =
cygwin_posix_to_win32_path_list,
cygwin_win32_to_posix_path_list_buf_size,
cygwin_posix_to_win32_path_list_buf_size},
- {NL ("HOME="), NULL, NULL, cygwin_conv_to_full_posix_path, cygwin_conv_to_full_win32_path,
- return_MAX_PATH, return_MAX_PATH},
+ {NL ("HOME="), NULL, NULL, cygwin_conv_to_full_posix_path,
+ cygwin_conv_to_full_win32_path, return_MAX_PATH, return_MAX_PATH},
{NL ("LD_LIBRARY_PATH="), NULL, NULL, cygwin_conv_to_full_posix_path,
cygwin_conv_to_full_win32_path, return_MAX_PATH, return_MAX_PATH},
- {NL ("TMPDIR="), NULL, NULL, cygwin_conv_to_full_posix_path, cygwin_conv_to_full_win32_path,
- return_MAX_PATH, return_MAX_PATH},
- {NL ("TMP="), NULL, NULL, cygwin_conv_to_full_posix_path, cygwin_conv_to_full_win32_path,
- return_MAX_PATH, return_MAX_PATH},
- {NL ("TEMP="), NULL, NULL, cygwin_conv_to_full_posix_path, cygwin_conv_to_full_win32_path,
- return_MAX_PATH, return_MAX_PATH},
+ {NL ("TMPDIR="), NULL, NULL, cygwin_conv_to_full_posix_path,
+ cygwin_conv_to_full_win32_path, return_MAX_PATH, return_MAX_PATH},
+ {NL ("TMP="), NULL, NULL, cygwin_conv_to_full_posix_path,
+ cygwin_conv_to_full_win32_path, return_MAX_PATH, return_MAX_PATH},
+ {NL ("TEMP="), NULL, NULL, cygwin_conv_to_full_posix_path,
+ cygwin_conv_to_full_win32_path, return_MAX_PATH, return_MAX_PATH},
{NULL, 0, NULL, NULL, NULL, NULL, 0, 0}
};
@@ -780,18 +780,30 @@ spenv::retrieve (bool no_envblock, const char *const envname)
{
if (envname && !strncasematch (envname, name, namelen))
return NULL;
+
+ debug_printf ("no_envblock %d", no_envblock);
+
if (from_cygheap)
{
const char *p;
- if (!cygheap->user.issetuid ())
+ if (cygheap->user.issetuid ())
+ debug_printf ("calculating for setuid");
+ else
{
+ debug_printf ("calculating for non-setuid");
if (!envname)
- return NULL; /* No need to force these into the
+ {
+ debug_printf ("not adding %s to windows environment", name);
+ return NULL; /* No need to force these into the
environment */
+ }
if (no_envblock)
- return cstrdup1 (envname); /* Don't really care what it's set to
+ {
+ debug_printf ("duping existing value for '%s'", name);
+ return cstrdup1 (envname);/* Don't really care what it's set to
if we're calling a cygwin program */
+ }
}
/* Calculate (potentially) value for given environment variable. */
@@ -801,6 +813,7 @@ spenv::retrieve (bool no_envblock, const char *const envname)
char *s = (char *) cmalloc (HEAP_1_STR, namelen + strlen (p) + 1);
strcpy (s, name);
(void) strcpy (s + namelen, p);
+ debug_printf ("using computed value for '%s'", name);
return s;
}
@@ -814,7 +827,11 @@ spenv::retrieve (bool no_envblock, const char *const envname)
char *p = (char *) cmalloc (HEAP_1_STR, namelen + ++vallen);
strcpy (p, name);
if (GetEnvironmentVariable (name, p + namelen, vallen))
- return p;
+ {
+ debug_printf ("using value from GetEnvironmentVariable for '%s'",
+ envname);
+ return p;
+ }
else
cfree (p);
}