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).
This commit is contained in:
parent
8530712dff
commit
50e4e9283d
@ -134,12 +134,12 @@ int RAND_write_file(const char *file)
|
|||||||
FILE *out = NULL;
|
FILE *out = NULL;
|
||||||
int n;
|
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 */
|
/* For some reason Win32 can't write to files created this way */
|
||||||
|
|
||||||
/* chmod(..., 0600) is too late to protect the file,
|
/* chmod(..., 0600) is too late to protect the file,
|
||||||
* permissions should be restrictive from the start */
|
* permissions should be restrictive from the start */
|
||||||
int fd = open(file, O_CREAT | O_EXCL, 0600);
|
int fd = open(file, O_CREAT, 0600);
|
||||||
if (fd != -1)
|
if (fd != -1)
|
||||||
out = fdopen(fd, "wb");
|
out = fdopen(fd, "wb");
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user