diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2005-09-28 00:34:19 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2005-09-28 00:34:19 +0400 |
commit | 22704a8da39db692d8c3c65f3d636d247984f85b (patch) | |
tree | 9f2d23ea7f833b10273e52a13dc8b170d6654bad /winsup/cygwin | |
parent | f1cdab8563361648a8585f0f43fe070d6b440fc9 (diff) |
* pthread.cc (mangle_sem_name): Use cygheap->shared_prefix instead
of fiddling with wincap.has_terminal_services manually.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/pthread.cc | 13 |
2 files changed, 13 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index fca90f7b2..f54b62ec7 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,10 @@ 2005-09-27 Corinna Vinschen <corinna@vinschen.de> + * pthread.cc (mangle_sem_name): Use cygheap->shared_prefix instead + of fiddling with wincap.has_terminal_services manually. + +2005-09-27 Corinna Vinschen <corinna@vinschen.de> + * cygheap.cc (cygheap_init): Add GLOBAL_PRIV to hProcToken explicitely since hProcImpToken isn't initialized here. * shared.cc (open_shared): Always print mapname instead of name in diff --git a/winsup/cygwin/pthread.cc b/winsup/cygwin/pthread.cc index 956d70a42..949bc0970 100644 --- a/winsup/cygwin/pthread.cc +++ b/winsup/cygwin/pthread.cc @@ -13,6 +13,10 @@ #include "winsup.h" #include "thread.h" #include "cygerrno.h" +#include "path.h" +#include "fhandler.h" +#include "dtable.h" +#include "cygheap.h" #include <stdarg.h> #include <sys/fcntl.h> #include "cygtls.h" @@ -174,15 +178,14 @@ mangle_sem_name (char *mangled, const char *name) set_errno (ENOENT); return false; } - int len = strlen (name); - if (len >= CYG_MAX_PATH - || (wincap.has_terminal_services () && len >= CYG_MAX_PATH - 7)) + size_t len = strlen (cygheap->shared_prefix); + if (strlen (name) >= CYG_MAX_PATH - len) { set_errno (EINVAL); return false; } - strcpy (mangled, wincap.has_terminal_services () ? "Global\\" : ""); - char *d = mangled + strlen (mangled); + strcpy (mangled, cygheap->shared_prefix); + char *d = mangled + len; const char *s = name; while (*s) *d++ = (*s == '\\') ? '/' : *s++; |