* path.cc (cwdstuff::set): When SetCurrentDirectory returns

ERROR_INVALID_FUNCTION, bend it over to ERROR_FILE_NOT_FOUND.  Add
	comment to explain why.
This commit is contained in:
Corinna Vinschen
2006-01-31 14:43:37 +00:00
parent 82cac98f3e
commit 735229ff4f
2 changed files with 16 additions and 0 deletions

View File

@ -3975,6 +3975,10 @@ cwdstuff::set (const char *win32_cwd, const char *posix_cwd, bool doit)
cwd_lock.acquire ();
if (doit && !SetCurrentDirectory (win32_cwd))
{
/* When calling SetCurrentDirectory for a non-existant dir on a
Win9x share, it returns ERROR_INVALID_FUNCTION. */
if (GetLastError () == ERROR_INVALID_FUNCTION)
SetLastError (ERROR_FILE_NOT_FOUND);
__seterrno ();
goto out;
}