зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
d548ded4dd
Коммит
71ed167934
|
@ -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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче