From: Corinna Vinschen Date: Fri, 15 Feb 2019 11:24:47 +0000 (+0100) Subject: cygwin: drop explicit O_TEXT X-Git-Tag: OpenSSL_1_1_1b~24 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a81cc6e8a240b27d0e0e6404dd29970375a4f5fc;p=oweals%2Fopenssl.git cygwin: drop explicit O_TEXT Cygwin binaries should not enforce text mode these days, just use text mode if the underlying mount point requests it Signed-off-by: Corinna Vinschen Reviewed-by: Matt Caswell Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/8248) (cherry picked from commit 9b57e4a1ef356420367d843f1ba96037f88316b8) --- diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c index 8de2391267..80fa108ffb 100644 --- a/crypto/bio/bss_file.c +++ b/crypto/bio/bss_file.c @@ -253,9 +253,7 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr) } # elif defined(OPENSSL_SYS_WIN32_CYGWIN) int fd = fileno((FILE *)ptr); - if (num & BIO_FP_TEXT) - setmode(fd, O_TEXT); - else + if (!(num & BIO_FP_TEXT)) setmode(fd, O_BINARY); # endif } @@ -279,11 +277,14 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr) ret = 0; break; } -# if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32_CYGWIN) +# if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WINDOWS) if (!(num & BIO_FP_TEXT)) OPENSSL_strlcat(p, "b", sizeof(p)); else OPENSSL_strlcat(p, "t", sizeof(p)); +# elif defined(OPENSSL_SYS_WIN32_CYGWIN) + if (!(num & BIO_FP_TEXT)) + OPENSSL_strlcat(p, "b", sizeof(p)); # endif fp = openssl_fopen(ptr, p); if (fp == NULL) {