зеркало из https://github.com/mozilla/pjs.git
Bug 402460 CreateUnique is very slow and returns bogus error for write-protected directory r=bsmedberg a=mtschrep
This commit is contained in:
Родитель
6022d7faa2
Коммит
b8d466fd70
|
@ -837,7 +837,8 @@ nsLocalFile::Create(PRUint32 type, PRUint32 attributes)
|
||||||
if (type == NORMAL_FILE_TYPE)
|
if (type == NORMAL_FILE_TYPE)
|
||||||
{
|
{
|
||||||
PRFileDesc* file = PR_Open(mWorkingPath.get(), PR_RDONLY | PR_CREATE_FILE | PR_APPEND | PR_EXCL, attributes);
|
PRFileDesc* file = PR_Open(mWorkingPath.get(), PR_RDONLY | PR_CREATE_FILE | PR_APPEND | PR_EXCL, attributes);
|
||||||
if (!file) return NS_ERROR_FILE_ALREADY_EXISTS;
|
if (!file)
|
||||||
|
return NS_ErrorAccordingToNSPR();
|
||||||
|
|
||||||
PR_Close(file);
|
PR_Close(file);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
|
|
|
@ -1036,13 +1036,12 @@ nsLocalFile::Create(PRUint32 type, PRUint32 attributes)
|
||||||
if (type == NORMAL_FILE_TYPE)
|
if (type == NORMAL_FILE_TYPE)
|
||||||
{
|
{
|
||||||
PRFileDesc* file;
|
PRFileDesc* file;
|
||||||
OpenFile(mResolvedPath,
|
rv = OpenFile(mResolvedPath,
|
||||||
PR_RDONLY | PR_CREATE_FILE | PR_APPEND | PR_EXCL, attributes,
|
PR_RDONLY | PR_CREATE_FILE | PR_APPEND | PR_EXCL, attributes,
|
||||||
&file);
|
&file);
|
||||||
if (!file) return NS_ERROR_FILE_ALREADY_EXISTS;
|
if (file)
|
||||||
|
PR_Close(file);
|
||||||
PR_Close(file);
|
return rv;
|
||||||
return NS_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == DIRECTORY_TYPE)
|
if (type == DIRECTORY_TYPE)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче