diff options
author | Corinna Vinschen <vinschen@redhat.com> | 2019-02-18 22:37:37 +0100 |
---|---|---|
committer | Corinna Vinschen <vinschen@redhat.com> | 2019-02-18 22:37:37 +0100 |
commit | 68be523db761867cde2c5476cf43f8766c593b2a (patch) | |
tree | cc042b46aa16a7daff7dc158748b216327c67533 | |
parent | 54a622697eced33a6029fd5e7dd452cfb99bb72e (diff) |
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 <vinschen@redhat.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8275)
-rw-r--r-- | crypto/bio/bss_file.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c index 2edf244835..0240a0dd5a 100644 --- a/crypto/bio/bss_file.c +++ b/crypto/bio/bss_file.c @@ -255,9 +255,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 } @@ -281,11 +279,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)) strcat(p, "b"); else strcat(p, "t"); +# elif defined(OPENSSL_SYS_WIN32_CYGWIN) + if (!(num & BIO_FP_TEXT)) + strcat(p, "b"); # endif fp = openssl_fopen(ptr, p); if (fp == NULL) { |