Bug 43314.

r=Henry Sobotka <sobotka@axess.com>
a=brendan@mozilla.org
s=Robert O'Callahan <roc+moz@cs.cmu.edu>
This commit is contained in:
dougt@netscape.com
2000-06-27 03:35:32 +00:00
parent 11213355c5
commit 98c166ab5b
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);