зеркало из https://github.com/mozilla/gecko-dev.git
BugZilla 17558. PR_Open() gets PR_EXCL flag
This commit is contained in:
Родитель
210784fe9b
Коммит
847c29cc5e
|
@ -401,13 +401,21 @@ PRInt32 _MD_Open(const char *path, PRIntn flags, int mode)
|
||||||
hpb.ioParam.ioPermssn = perm;
|
hpb.ioParam.ioPermssn = perm;
|
||||||
|
|
||||||
|
|
||||||
|
if (flags & PR_CREATE_FILE) {
|
||||||
|
err = PBHCreateSync(&hpb);
|
||||||
|
|
||||||
|
/* If opening with the PR_EXCL flag the existence of the file prior to opening is an error */
|
||||||
|
if ((flags & PR_EXCL) && (err == dupFNErr)) {
|
||||||
|
err = PR_FILE_EXISTS_ERROR;
|
||||||
|
goto ErrorExit;
|
||||||
|
}
|
||||||
|
if (err != noErr)
|
||||||
|
goto ErrorExit;
|
||||||
|
}
|
||||||
|
|
||||||
open:
|
open:
|
||||||
err = PBHOpenDFSync(&hpb);
|
err = PBHOpenDFSync(&hpb);
|
||||||
if ((err == fnfErr) && (flags & PR_CREATE_FILE)) {
|
|
||||||
err = PBHCreateSync(&hpb);
|
|
||||||
if (err == noErr)
|
|
||||||
goto open;
|
|
||||||
}
|
|
||||||
if (err != noErr)
|
if (err != noErr)
|
||||||
goto ErrorExit;
|
goto ErrorExit;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче