* cygheap.h (init_cygheap): New struct holding values that live in the Cygwin
heap. * child_info.h (child_info): Change pointer type of cygheap to init_cygheap. * cygheap.cc (init_cheap): Point cygheap_max after contents of cygheap. Move some stuff into cygheap.h. * dir.cc (opendir): Change to use root and rootlen in cygheap rather than in myself. (mkdir): Change to use umask in cygheap rather than in myself. * path.cc: Ditto, throughout. * syscalls.cc (_open): Ditto. Change to use umask in cygheap rather than in myself. (chroot): Change to allocate root dir on the cygwin heap. (umask): Change to use umask in cygheap rather than in myself. (cygwin_bind): Ditto. * sigproc.cc (proc_subproc): Don't copy umask or root stuff as this happens automatically now. * pinfo.h (_pinfo): Migrate stuff out of here and into init_cheap. * dcrt0.cc (dll_crt0_1): Call cygheap_init later in startup for first cygwin process.
This commit is contained in:
@@ -24,6 +24,7 @@ details. */
|
||||
#include "fhandler.h"
|
||||
#include "path.h"
|
||||
#include "security.h"
|
||||
#include "cygheap.h"
|
||||
|
||||
/* Cygwin internal */
|
||||
/* Return whether the directory of a file is writable. Return 1 if it
|
||||
@@ -75,7 +76,7 @@ opendir (const char *dirname)
|
||||
goto failed;
|
||||
}
|
||||
|
||||
if (stat (myself->rootlen ? dirname : real_dirname.get_win32 (),
|
||||
if (stat (cygheap->rootlen ? dirname : real_dirname.get_win32 (),
|
||||
&statbuf) == -1)
|
||||
goto failed;
|
||||
|
||||
@@ -298,7 +299,7 @@ mkdir (const char *dir, mode_t mode)
|
||||
if (CreateDirectoryA (real_dir.get_win32 (), 0))
|
||||
{
|
||||
set_file_attribute (real_dir.has_acls (), real_dir.get_win32 (),
|
||||
S_IFDIR | ((mode & 0777) & ~myself->umask));
|
||||
S_IFDIR | ((mode & 0777) & ~cygheap->umask));
|
||||
res = 0;
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user