Bug 1177541 - Remove warning if file is not found during deferred open. r=mcmanus

When doing a deferred open we should not emit a warning if the file is not
found. The proper return code is still returned.
This commit is contained in:
Eric Rahm 2015-06-30 09:33:37 -07:00
parent ad1946e616
commit 65b068e988

View File

@ -202,6 +202,11 @@ nsresult
nsFileStreamBase::Read(char* aBuf, uint32_t aCount, uint32_t* aResult)
{
nsresult rv = DoPendingOpen();
if (rv == NS_ERROR_FILE_NOT_FOUND) {
// Don't warn if this is just a deferred file not found.
return rv;
}
NS_ENSURE_SUCCESS(rv, rv);
if (!mFD) {
@ -489,6 +494,11 @@ NS_IMETHODIMP
nsFileInputStream::Read(char* aBuf, uint32_t aCount, uint32_t* _retval)
{
nsresult rv = nsFileStreamBase::Read(aBuf, aCount, _retval);
if (rv == NS_ERROR_FILE_NOT_FOUND) {
// Don't warn if this is a deffered file not found.
return rv;
}
NS_ENSURE_SUCCESS(rv, rv);
// Check if we're at the end of file and need to close