зеркало из https://github.com/mozilla/gecko-dev.git
Bug 938683 - Catch and pass the error values of PR_Close() to upper layer. r=johns
This commit is contained in:
Родитель
5c74e41f57
Коммит
19a250cd9d
|
@ -2321,7 +2321,14 @@ nsPluginHost::WritePluginInfo()
|
|||
invalidPlugins = invalidPlugins->mNext;
|
||||
}
|
||||
|
||||
PR_Close(fd);
|
||||
PRStatus prrc;
|
||||
prrc = PR_Close(fd);
|
||||
if (prrc != PR_SUCCESS) {
|
||||
// we should obtain a refined value based on prrc;
|
||||
rv = NS_ERROR_FAILURE;
|
||||
MOZ_ASSERT(false, "PR_Close() failed.");
|
||||
return rv;
|
||||
}
|
||||
nsCOMPtr<nsIFile> parent;
|
||||
rv = pluginReg->GetParent(getter_AddRefs(parent));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
@ -2398,7 +2405,15 @@ nsPluginHost::ReadPluginInfo()
|
|||
rv = NS_ERROR_FAILURE;
|
||||
|
||||
int32_t bread = PR_Read(fd, registry, flen);
|
||||
PR_Close(fd);
|
||||
|
||||
PRStatus prrc;
|
||||
prrc = PR_Close(fd);
|
||||
if (prrc != PR_SUCCESS) {
|
||||
// Strange error: this is one of those "Should not happen" error.
|
||||
// we may want to report something more refined than NS_ERROR_FAILURE.
|
||||
MOZ_ASSERT(false, "PR_Close() failed.");
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (flen > bread)
|
||||
return rv;
|
||||
|
|
Загрузка…
Ссылка в новой задаче