FILE *out = NULL;
int n;
-#if defined(O_CREAT) && defined(O_EXCL) && !defined(WIN32)
+#if defined(O_CREAT) && !defined(WIN32)
/* For some reason Win32 can't write to files created this way */
-
- /* chmod(..., 0600) is too late to protect the file,
- * permissions should be restrictive from the start */
- int fd = open(file, O_CREAT | O_EXCL, 0600);
- if (fd != -1)
- out = fdopen(fd, "wb");
+
+ /* chmod(..., 0600) is too late to protect the file,
+ * permissions should be restrictive from the start */
+ int fd = open(file, O_CREAT, 0600);
+ if (fd != -1)
+ out = fdopen(fd, "wb");
#endif
- if (out == NULL)
- out = fopen(file,"wb");
- if (out == NULL) goto err;
+ if (out == NULL)
+ out = fopen(file,"wb");
+ if (out == NULL) goto err;
#ifndef NO_CHMOD
chmod(file,0600);