diff options
author | Rich Salz <rsalz@akamai.com> | 2019-07-31 22:24:20 +0300 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-08-02 12:41:54 +0300 |
commit | ff988500c2f39ae61b2836167b6e0e7b2021220c (patch) | |
tree | ead6acf74e2cf8c8be430e02f78dddcf8281b0cc /crypto/bio/bss_file.c | |
parent | 823ee00a396f91df4517af13dafae679ae10b3f4 (diff) |
Replace FUNCerr with ERR_raise_data
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9496)
Diffstat (limited to 'crypto/bio/bss_file.c')
-rw-r--r-- | crypto/bio/bss_file.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c index 0aa6b713b6..c1acad9851 100644 --- a/crypto/bio/bss_file.c +++ b/crypto/bio/bss_file.c @@ -66,8 +66,9 @@ BIO *BIO_new_file(const char *filename, const char *mode) fp_flags |= BIO_FP_TEXT; if (file == NULL) { - FUNCerr("fopen", get_last_sys_error()); - ERR_add_error_data(5, "fopen('", filename, "','", mode, "')"); + ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(), + "calling fopen(%s, %s)", + filename, mode); if (errno == ENOENT #ifdef ENXIO || errno == ENXIO @@ -146,7 +147,8 @@ static int file_read(BIO *b, char *out, int outl) if (ret == 0 && (b->flags & BIO_FLAGS_UPLINK_INTERNAL ? UP_ferror((FILE *)b->ptr) : ferror((FILE *)b->ptr))) { - FUNCerr("fread", get_last_sys_error()); + ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(), + "calling fread()"); BIOerr(BIO_F_FILE_READ, ERR_R_SYS_LIB); ret = -1; } @@ -285,8 +287,9 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr) # endif fp = openssl_fopen(ptr, p); if (fp == NULL) { - FUNCerr("fopen", get_last_sys_error()); - ERR_add_error_data(5, "fopen('", ptr, "','", p, "')"); + ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(), + "calling fopen(%s, %s)", + ptr, p); BIOerr(BIO_F_FILE_CTRL, ERR_R_SYS_LIB); ret = 0; break; @@ -313,8 +316,8 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr) st = b->flags & BIO_FLAGS_UPLINK_INTERNAL ? UP_fflush(b->ptr) : fflush((FILE *)b->ptr); if (st == EOF) { - FUNCerr("fflush", get_last_sys_error()); - ERR_add_error_data(1, "fflush()"); + ERR_raise_data(ERR_LIB_SYS, get_last_sys_error(), + "calling fflush()"); BIOerr(BIO_F_FILE_CTRL, ERR_R_SYS_LIB); ret = 0; } |