From: Andy Polyakov Date: Mon, 19 Mar 2018 17:12:31 +0000 (+0100) Subject: o_fopen.c,rand/randfile.c: compensate for e_os.h omission. X-Git-Tag: OpenSSL_1_1_1-pre4~89 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9d9dc6ac852a74836ba15a3ed10b3ecb6581fd1b;p=oweals%2Fopenssl.git o_fopen.c,rand/randfile.c: compensate for e_os.h omission. At earlier point e_os.h was omitted from a number of headers (in order to emphasize OS neutrality), but this affected o_fopen.c and randfile.c which are not OS-neutral, and contain some Win32-specific code. Reviewed-by: Rich Salz Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/5676) --- diff --git a/crypto/o_fopen.c b/crypto/o_fopen.c index a3a006574d..951d034dda 100644 --- a/crypto/o_fopen.c +++ b/crypto/o_fopen.c @@ -12,6 +12,9 @@ #if !defined(OPENSSL_NO_STDIO) # include +# ifdef _WIN32 +# include +# endif FILE *openssl_fopen(const char *filename, const char *mode) { diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c index d4edc50b26..a979eb99a2 100644 --- a/crypto/rand/randfile.c +++ b/crypto/rand/randfile.c @@ -26,7 +26,12 @@ # include # include # ifdef _WIN32 +# include # include +# define stat _stat +# define chmod _chmod +# define open _open +# define fdopen _fdopen # endif #endif @@ -41,13 +46,6 @@ # define S_ISREG(m) ((m) & S_IFREG) # endif -#ifdef _WIN32 -# define stat _stat -# define chmod _chmod -# define open _open -# define fdopen _fdopen -#endif - #define RAND_FILE_SIZE 1024 #define RFILE ".rnd"