* 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:
Corinna Vinschen
2008-01-31 14:18:49 +00:00
parent 3fbb5e3d80
commit 8e87af7ed0
3 changed files with 41 additions and 31 deletions

View File

@ -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 ();