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:
authorCorinna Vinschen <corinna@vinschen.de>2003-12-01 18:03:43 +0300
committerCorinna Vinschen <corinna@vinschen.de>2003-12-01 18:03:43 +0300
commit6c2b7846124572ffed3ce4fea074cc89e732651c (patch)
tree864e724e3480a3f4662f895e5874de95d9beed9c /winsup
parent4febe95f89e491c20503330fbad530d53d7ea4fa (diff)
* cygheap.cc (cygheap_init): Set cygheap->shared_prefix.
* cygheap.h (struct init_cygheap): Add shared_prefix. * shared.cc (shared_name): Use cygheap->shared_prefix.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/cygheap.cc6
-rw-r--r--winsup/cygwin/cygheap.h1
-rw-r--r--winsup/cygwin/shared.cc6
4 files changed, 14 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 12f2b7001..d23b19b1f 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2003-12-01 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygheap.cc (cygheap_init): Set cygheap->shared_prefix.
+ * cygheap.h (struct init_cygheap): Add shared_prefix.
+ * shared.cc (shared_name): Use cygheap->shared_prefix.
+
2003-12-01 Pierre Humblet <pierre.humblet@ieee.org>
* shared.cc (shared_name): Take into account the SE_CREATE_GLOBAL_NAME
diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc
index ede408695..6859e4335 100644
--- a/winsup/cygwin/cygheap.cc
+++ b/winsup/cygwin/cygheap.cc
@@ -206,6 +206,12 @@ cygheap_init ()
cygheap->fdtab.init ();
if (!cygheap->sigs)
sigalloc ();
+ if (!cygheap->shared_prefix)
+ cygheap->shared_prefix = cstrdup (
+ wincap.has_terminal_services ()
+ && (set_process_privilege (SE_CREATE_GLOBAL_NAME, true) >= 0
+ || GetLastError () == ERROR_NO_SUCH_PRIVILEGE)
+ ? "Global\\" : "");
}
/* Copyright (C) 1997, 2000 DJ Delorie */
diff --git a/winsup/cygwin/cygheap.h b/winsup/cygwin/cygheap.h
index 8b84e64f2..9ce51cc33 100644
--- a/winsup/cygwin/cygheap.h
+++ b/winsup/cygwin/cygheap.h
@@ -254,6 +254,7 @@ struct init_cygheap
char *cygwin_regname;
cwdstuff cwd;
dtable fdtab;
+ const char *shared_prefix;
#ifdef DEBUGGING
cygheap_debug debug;
#endif
diff --git a/winsup/cygwin/shared.cc b/winsup/cygwin/shared.cc
index a0d9e9655..9a91a1c08 100644
--- a/winsup/cygwin/shared.cc
+++ b/winsup/cygwin/shared.cc
@@ -35,12 +35,8 @@ char * __stdcall
shared_name (char *ret_buf, const char *str, int num)
{
extern bool _cygwin_testing;
- static const char *prefix =
- wincap.has_terminal_services ()
- && (set_process_privilege (SE_CREATE_GLOBAL_NAME, true) >= 0
- || GetLastError () == ERROR_NO_SUCH_PRIVILEGE) ? "Global\\" : "";
- __small_sprintf (ret_buf, "%s%s.%s.%d", prefix,
+ __small_sprintf (ret_buf, "%s%s.%s.%d", cygheap->shared_prefix,
cygwin_version.shared_id, str, num);
if (_cygwin_testing)
strcat (ret_buf, cygwin_version.dll_build_date);