зеркало из 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)
|
||||
{
|
||||
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);
|
||||
return NS_OK;
|
||||
|
|
|
@ -1036,13 +1036,12 @@ nsLocalFile::Create(PRUint32 type, PRUint32 attributes)
|
|||
if (type == NORMAL_FILE_TYPE)
|
||||
{
|
||||
PRFileDesc* file;
|
||||
OpenFile(mResolvedPath,
|
||||
PR_RDONLY | PR_CREATE_FILE | PR_APPEND | PR_EXCL, attributes,
|
||||
&file);
|
||||
if (!file) return NS_ERROR_FILE_ALREADY_EXISTS;
|
||||
|
||||
PR_Close(file);
|
||||
return NS_OK;
|
||||
rv = OpenFile(mResolvedPath,
|
||||
PR_RDONLY | PR_CREATE_FILE | PR_APPEND | PR_EXCL, attributes,
|
||||
&file);
|
||||
if (file)
|
||||
PR_Close(file);
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (type == DIRECTORY_TYPE)
|
||||
|
|
Загрузка…
Ссылка в новой задаче