summaryrefslogtreecommitdiff
path: root/Cryptlib/OpenSSL/crypto/bio/bss_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'Cryptlib/OpenSSL/crypto/bio/bss_file.c')
-rw-r--r--Cryptlib/OpenSSL/crypto/bio/bss_file.c30
1 files changed, 10 insertions, 20 deletions
diff --git a/Cryptlib/OpenSSL/crypto/bio/bss_file.c b/Cryptlib/OpenSSL/crypto/bio/bss_file.c
index 153b6fa2..bfba93e6 100644
--- a/Cryptlib/OpenSSL/crypto/bio/bss_file.c
+++ b/Cryptlib/OpenSSL/crypto/bio/bss_file.c
@@ -115,9 +115,8 @@ static BIO_METHOD methods_filep = {
NULL,
};
-BIO *BIO_new_file(const char *filename, const char *mode)
+static FILE *file_fopen(const char *filename, const char *mode)
{
- BIO *ret;
FILE *file = NULL;
# if defined(_WIN32) && defined(CP_UTF8)
@@ -164,6 +163,14 @@ BIO *BIO_new_file(const char *filename, const char *mode)
# else
file = fopen(filename, mode);
# endif
+ return (file);
+}
+
+BIO *BIO_new_file(const char *filename, const char *mode)
+{
+ BIO *ret;
+ FILE *file = file_fopen(filename, mode);
+
if (file == NULL) {
SYSerr(SYS_F_FOPEN, get_last_sys_error());
ERR_add_error_data(5, "fopen('", filename, "','", mode, "')");
@@ -386,7 +393,7 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr)
else
strcat(p, "t");
# endif
- fp = fopen(ptr, p);
+ fp = file_fopen(ptr, p);
if (fp == NULL) {
SYSerr(SYS_F_FOPEN, get_last_sys_error());
ERR_add_error_data(5, "fopen('", ptr, "','", p, "')");
@@ -460,23 +467,6 @@ static int MS_CALLBACK file_puts(BIO *bp, const char *str)
return (ret);
}
-# else
-
-BIO_METHOD *BIO_s_file(void)
-{
- return NULL;
-}
-
-BIO *BIO_new_file(const char *filename, const char *mode)
-{
- return NULL;
-}
-
-BIO *BIO_new_fp(FILE *stream, int close_flag)
-{
- return NULL;
-}
-
# endif /* OPENSSL_NO_STDIO */
#endif /* HEADER_BSS_FILE_C */