* cygheap.h (struct cwdstuff): Add dir member to store cwd handle.
(cwdstuff::get_handle): New method. * path.cc (cwdstuff::set): When doit is true, always try to get directory handle. Fail if duplicating handle fails. Store handle in dir. Fix potential SEGV when setting drive_length.
This commit is contained in:
@ -223,9 +223,11 @@ struct cwdstuff
|
||||
{
|
||||
char *posix;
|
||||
UNICODE_STRING win32;
|
||||
HANDLE dir;
|
||||
DWORD drive_length;
|
||||
static muto cwd_lock;
|
||||
char *get (char *, int = 1, int = 0, unsigned = CYG_MAX_PATH);
|
||||
HANDLE get_handle () { return dir; }
|
||||
DWORD get_drive (char * dst)
|
||||
{
|
||||
cwd_lock.acquire ();
|
||||
|
Reference in New Issue
Block a user