X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;ds=inline;f=crypto%2Frand%2Frandfile.c;h=d69bdf8b8a04031abe2c1d65df5a29347a87f98c;hb=20a90e3a76135c34b4988ba3cc2835603d98639a;hp=fd903528485e1e76aede5ef9503a7db8b40499fe;hpb=a481b4b52ce48aec3ccc6583a95e60cbb5c3042b;p=oweals%2Fopenssl.git diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c index fd90352848..d69bdf8b8a 100644 --- a/crypto/rand/randfile.c +++ b/crypto/rand/randfile.c @@ -57,7 +57,7 @@ */ /* We need to define this to get macros like S_IFBLK and S_IFCHR */ -#define _XOPEN_SOURCE 1 +#define _XOPEN_SOURCE 500 #include #include @@ -166,6 +166,7 @@ int RAND_write_file(const char *file) } #if defined(O_CREAT) && !defined(OPENSSL_SYS_WIN32) + { /* For some reason Win32 can't write to files created this way */ /* chmod(..., 0600) is too late to protect the file, @@ -173,6 +174,7 @@ int RAND_write_file(const char *file) int fd = open(file, O_CREAT, 0600); if (fd != -1) out = fdopen(fd, "wb"); + } #endif if (out == NULL) out = fopen(file,"wb");