* pthread.cc (mangle_sem_name): Use cygheap->shared_prefix instead
of fiddling with wincap.has_terminal_services manually.
This commit is contained in:
parent
f1cdab8563
commit
22704a8da3
|
@ -1,3 +1,8 @@
|
||||||
|
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>
|
2005-09-27 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* cygheap.cc (cygheap_init): Add GLOBAL_PRIV to hProcToken explicitely
|
* cygheap.cc (cygheap_init): Add GLOBAL_PRIV to hProcToken explicitely
|
||||||
|
|
|
@ -13,6 +13,10 @@
|
||||||
#include "winsup.h"
|
#include "winsup.h"
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "cygerrno.h"
|
#include "cygerrno.h"
|
||||||
|
#include "path.h"
|
||||||
|
#include "fhandler.h"
|
||||||
|
#include "dtable.h"
|
||||||
|
#include "cygheap.h"
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <sys/fcntl.h>
|
#include <sys/fcntl.h>
|
||||||
#include "cygtls.h"
|
#include "cygtls.h"
|
||||||
|
@ -174,15 +178,14 @@ mangle_sem_name (char *mangled, const char *name)
|
||||||
set_errno (ENOENT);
|
set_errno (ENOENT);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int len = strlen (name);
|
size_t len = strlen (cygheap->shared_prefix);
|
||||||
if (len >= CYG_MAX_PATH
|
if (strlen (name) >= CYG_MAX_PATH - len)
|
||||||
|| (wincap.has_terminal_services () && len >= CYG_MAX_PATH - 7))
|
|
||||||
{
|
{
|
||||||
set_errno (EINVAL);
|
set_errno (EINVAL);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
strcpy (mangled, wincap.has_terminal_services () ? "Global\\" : "");
|
strcpy (mangled, cygheap->shared_prefix);
|
||||||
char *d = mangled + strlen (mangled);
|
char *d = mangled + len;
|
||||||
const char *s = name;
|
const char *s = name;
|
||||||
while (*s)
|
while (*s)
|
||||||
*d++ = (*s == '\\') ? '/' : *s++;
|
*d++ = (*s == '\\') ? '/' : *s++;
|
||||||
|
|
Loading…
Reference in New Issue