mirror of
https://github.com/openssl/openssl.git
synced 2025-02-23 14:42:15 +08:00
Rename binmode into textmode and use it correctly
Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
parent
9b56815d5f
commit
1cd5cc368f
@ -2796,7 +2796,7 @@ BIO *bio_open_owner(const char *filename, int format, int private)
|
|||||||
{
|
{
|
||||||
FILE *fp = NULL;
|
FILE *fp = NULL;
|
||||||
BIO *b = NULL;
|
BIO *b = NULL;
|
||||||
int fd = -1, bflags, mode, binmode;
|
int fd = -1, bflags, mode, textmode;
|
||||||
|
|
||||||
if (!private || filename == NULL || strcmp(filename, "-") == 0)
|
if (!private || filename == NULL || strcmp(filename, "-") == 0)
|
||||||
return bio_open_default(filename, 'w', format);
|
return bio_open_default(filename, 'w', format);
|
||||||
@ -2808,8 +2808,8 @@ BIO *bio_open_owner(const char *filename, int format, int private)
|
|||||||
#ifdef O_TRUNC
|
#ifdef O_TRUNC
|
||||||
mode |= O_TRUNC;
|
mode |= O_TRUNC;
|
||||||
#endif
|
#endif
|
||||||
binmode = istext(format);
|
textmode = istext(format);
|
||||||
if (binmode) {
|
if (!textmode) {
|
||||||
#ifdef O_BINARY
|
#ifdef O_BINARY
|
||||||
mode |= O_BINARY;
|
mode |= O_BINARY;
|
||||||
#elif defined(_O_BINARY)
|
#elif defined(_O_BINARY)
|
||||||
@ -2824,7 +2824,7 @@ BIO *bio_open_owner(const char *filename, int format, int private)
|
|||||||
if (fp == NULL)
|
if (fp == NULL)
|
||||||
goto err;
|
goto err;
|
||||||
bflags = BIO_CLOSE;
|
bflags = BIO_CLOSE;
|
||||||
if (!binmode)
|
if (textmode)
|
||||||
bflags |= BIO_FP_TEXT;
|
bflags |= BIO_FP_TEXT;
|
||||||
b = BIO_new_fp(fp, bflags);
|
b = BIO_new_fp(fp, bflags);
|
||||||
if (b)
|
if (b)
|
||||||
|
Loading…
Reference in New Issue
Block a user