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