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
Родитель 09eb59ac3d
Коммит c7c7afa9ce
1 изменённых файлов: 10 добавлений и 0 удалений

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

@ -202,6 +202,11 @@ nsresult
nsFileStreamBase::Read(char* aBuf, uint32_t aCount, uint32_t* aResult) nsFileStreamBase::Read(char* aBuf, uint32_t aCount, uint32_t* aResult)
{ {
nsresult rv = DoPendingOpen(); 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); NS_ENSURE_SUCCESS(rv, rv);
if (!mFD) { if (!mFD) {
@ -489,6 +494,11 @@ NS_IMETHODIMP
nsFileInputStream::Read(char* aBuf, uint32_t aCount, uint32_t* _retval) nsFileInputStream::Read(char* aBuf, uint32_t aCount, uint32_t* _retval)
{ {
nsresult rv = nsFileStreamBase::Read(aBuf, aCount, _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); NS_ENSURE_SUCCESS(rv, rv);
// Check if we're at the end of file and need to close // Check if we're at the end of file and need to close