Bug 43314.

r=Henry Sobotka <sobotka@axess.com>
a=brendan@mozilla.org
s=Robert O'Callahan <roc+moz@cs.cmu.edu>


git-svn-id: svn://10.0.0.236/trunk@73281 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dougt%netscape.com
2000-06-27 03:35:32 +00:00
parent efb5386074
commit ba45beb562
2 changed files with 8 additions and 3 deletions

View File

@@ -363,6 +363,9 @@ nsLocalFile::OpenANSIFileDesc(const char *mode, FILE * *_retval)
return NS_ERROR_FAILURE;
}
static int exclusive_create(const char * path, mode_t mode) {
return open(path, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, mode);
}
NS_IMETHODIMP
nsLocalFile::Create(PRUint32 type, PRUint32 permissions)
@@ -378,7 +381,7 @@ nsLocalFile::Create(PRUint32 type, PRUint32 permissions)
#else
int (*creationFunc)(const char *, mode_t) =
#endif
type == NORMAL_FILE_TYPE ? creat : mkdir;
type == NORMAL_FILE_TYPE ? exclusive_create : mkdir;
result = creationFunc((const char *)mPath, permissions);