From c0aa10d601eb5f388e154d7fd27e668b3472286b Mon Sep 17 00:00:00 2001 From: "tingley%sundell.net" Date: Sat, 22 Dec 2001 19:08:48 +0000 Subject: [PATCH] bug 100132: clean up over-zealous error masking in nsRDFXMLDataSource::BlockingParse(), and bring nsLocalFileUnix's OpenNSPRFileDesc() return values in line with other platforms. r=waterson, sr=brendan git-svn-id: svn://10.0.0.236/trunk@111039 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/rdf/base/src/nsRDFXMLDataSource.cpp | 5 +++-- mozilla/xpcom/io/nsLocalFileUnix.cpp | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/mozilla/rdf/base/src/nsRDFXMLDataSource.cpp b/mozilla/rdf/base/src/nsRDFXMLDataSource.cpp index 9491df4bdc8..43c290aebeb 100644 --- a/mozilla/rdf/base/src/nsRDFXMLDataSource.cpp +++ b/mozilla/rdf/base/src/nsRDFXMLDataSource.cpp @@ -560,8 +560,9 @@ RDFXMLDataSourceImpl::BlockingParse(nsIURI* aURL, nsIStreamListener* aConsumer) PRUint32 sourceOffset = 0; rv = channel->Open(&in); - // If we couldn't open the channel, then just return. - if (NS_FAILED(rv)) return NS_OK; + // Report success if the file doesn't exist, but propagate other errors. + if (rv == NS_ERROR_FILE_NOT_FOUND) return NS_OK; + if (NS_FAILED(rv)) return rv; NS_ASSERTION(in != nsnull, "no input stream"); if (! in) return NS_ERROR_FAILURE; diff --git a/mozilla/xpcom/io/nsLocalFileUnix.cpp b/mozilla/xpcom/io/nsLocalFileUnix.cpp index 09fcab9030a..a2d6ad73d0a 100644 --- a/mozilla/xpcom/io/nsLocalFileUnix.cpp +++ b/mozilla/xpcom/io/nsLocalFileUnix.cpp @@ -350,7 +350,7 @@ nsLocalFile::OpenNSPRFileDesc(PRInt32 flags, PRInt32 mode, PRFileDesc **_retval) *_retval = PR_Open(mPath.get(), flags, mode); if (! *_retval) - return NS_ERROR_FAILURE; + return NS_ErrorAccordingToNSPR(); return NS_OK; }