Make GetFSRefInternal assume NS_ERROR_FILE_NOT_FOUND when CFURLGetFSRef

returns false.
b=202772; r=ssu, ccarlen; sr=sfraser; a=asa
This commit is contained in:
sgehani%netscape.com 2003-05-21 00:53:36 +00:00
Родитель d548ded4dd
Коммит 71ed167934
1 изменённых файлов: 6 добавлений и 9 удалений

Просмотреть файл

@ -938,11 +938,8 @@ NS_IMETHODIMP nsLocalFile::IsDirectory(PRBool *_retval)
FSRef fsRef;
nsresult rv = GetFSRefInternal(fsRef, PR_FALSE);
// CFURLGetFSRef only returns a Boolean for success,
// so we have to assume what the error was. This is
// the only probable cause.
if (NS_FAILED(rv))
return NS_ERROR_FILE_NOT_FOUND;
return rv;
FSCatalogInfo catalogInfo;
OSErr err = ::FSGetCatalogInfo(&fsRef, kFSCatInfoNodeFlags, &catalogInfo,
@ -961,11 +958,8 @@ NS_IMETHODIMP nsLocalFile::IsFile(PRBool *_retval)
FSRef fsRef;
nsresult rv = GetFSRefInternal(fsRef, PR_FALSE);
// CFURLGetFSRef only returns a Boolean for success,
// so we have to assume what the error was. This is
// the only probable cause.
if (NS_FAILED(rv))
return NS_ERROR_FILE_NOT_FOUND;
return rv;
FSCatalogInfo catalogInfo;
OSErr err = ::FSGetCatalogInfo(&fsRef, kFSCatInfoNodeFlags, &catalogInfo,
@ -1900,7 +1894,10 @@ nsresult nsLocalFile::GetFSRefInternal(FSRef& aFSRef, PRBool bForceUpdateCache)
aFSRef = mCachedFSRef;
return NS_OK;
}
return NS_ERROR_FAILURE;
// CFURLGetFSRef only returns a Boolean for success,
// so we have to assume what the error was. This is
// the only probable cause.
return NS_ERROR_FILE_NOT_FOUND;
}
nsresult nsLocalFile::GetPathInternal(nsACString& path)