aboutsummaryrefslogtreecommitdiff
path: root/crypto/rand/randfile.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2000-05-11 23:10:27 +0000
committerBodo Möller <bodo@openssl.org>2000-05-11 23:10:27 +0000
commit50e4e9283d30a3d70aa7b6091196674155c88005 (patch)
tree156d36f23cfc076257a601ec71e0d0dd83624c07 /crypto/rand/randfile.c
parent8530712dffaffeb26e6825a9907e73dedaa21bdf (diff)
downloadopenssl-50e4e9283d30a3d70aa7b6091196674155c88005.zip
openssl-50e4e9283d30a3d70aa7b6091196674155c88005.tar.gz
openssl-50e4e9283d30a3d70aa7b6091196674155c88005.tar.bz2
When open()ing 'file' in RAND_write_file, don't use O_EXCL.
This is superfluous now that we don't have to avoid creating multiple versions of the file on VMS (because older versions are now deleted).
Diffstat (limited to 'crypto/rand/randfile.c')
-rw-r--r--crypto/rand/randfile.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c
index 9ff3974..d01b985 100644
--- a/crypto/rand/randfile.c
+++ b/crypto/rand/randfile.c
@@ -134,18 +134,18 @@ int RAND_write_file(const char *file)
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);