* path.cc (cwdstuff::set): Don't try to open directory on systems not

supporting that.
This commit is contained in:
Corinna Vinschen 2006-12-05 13:20:38 +00:00
parent a83c59fbc3
commit 2156546df2
2 changed files with 15 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2006-12-05 Corinna Vinschen <corinna@vinschen.de>
* path.cc (cwdstuff::set): Don't try to open directory on systems not
supporting that.
2006-12-05 Corinna Vinschen <corinna@vinschen.de> 2006-12-05 Corinna Vinschen <corinna@vinschen.de>
* dcrt0.cc (get_cygwin_startup_info): Fix comment. * dcrt0.cc (get_cygwin_startup_info): Fix comment.

View File

@ -4214,6 +4214,8 @@ cwdstuff::set (const char *win32_cwd, const char *posix_cwd, bool doit)
set_errno (ENOTDIR); set_errno (ENOTDIR);
goto out; goto out;
} }
if (wincap.can_open_directories ())
{
HANDLE h = CreateFile (win32_cwd, GENERIC_READ, wincap.shared (), HANDLE h = CreateFile (win32_cwd, GENERIC_READ, wincap.shared (),
NULL, OPEN_EXISTING, NULL, OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS, NULL); FILE_FLAG_BACKUP_SEMANTICS, NULL);
@ -4225,6 +4227,7 @@ cwdstuff::set (const char *win32_cwd, const char *posix_cwd, bool doit)
CloseHandle (h); CloseHandle (h);
} }
} }
}
/* If there is no win32 path or it has the form c:xxx, get the value */ /* If there is no win32 path or it has the form c:xxx, get the value */
if (!win32_cwd || (isdrive (win32_cwd) && win32_cwd[2] != '\\')) if (!win32_cwd || (isdrive (win32_cwd) && win32_cwd[2] != '\\'))
{ {