diff options
author | Rich Salz <rsalz@akamai.com> | 2019-06-11 22:42:42 +0300 |
---|---|---|
committer | Tomas Mraz <tmraz@fedoraproject.org> | 2019-07-22 17:24:56 +0300 |
commit | 56c3a135b239f4c8ccfdbbb1668880d4c39d5b87 (patch) | |
tree | 22bf3958a3b0046ae690e57dd5eaad90c6fcf25a /crypto/bio/bss_file.c | |
parent | 1372560f64c9a7cfad1979fa8c41bee335a04373 (diff) |
Add ERR_put_func_error, and use it.
Change SYSerr to have the function name; remove SYS_F_xxx defines
Add a test and documentation.
Use get_last_socket_err, which removes some ifdef's in OpenSSL code.
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9072)
Diffstat (limited to 'crypto/bio/bss_file.c')
-rw-r--r-- | crypto/bio/bss_file.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c index 0e07632f7e..d0afd10214 100644 --- a/crypto/bio/bss_file.c +++ b/crypto/bio/bss_file.c @@ -69,7 +69,7 @@ BIO *BIO_new_file(const char *filename, const char *mode) fp_flags |= BIO_FP_TEXT; if (file == NULL) { - SYSerr(SYS_F_FOPEN, get_last_sys_error()); + SYSerr("fopen", get_last_sys_error()); ERR_add_error_data(5, "fopen('", filename, "','", mode, "')"); if (errno == ENOENT # ifdef ENXIO @@ -149,7 +149,7 @@ 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))) { - SYSerr(SYS_F_FREAD, get_last_sys_error()); + SYSerr("fread", get_last_sys_error()); BIOerr(BIO_F_FILE_READ, ERR_R_SYS_LIB); ret = -1; } @@ -288,7 +288,7 @@ static long file_ctrl(BIO *b, int cmd, long num, void *ptr) # endif fp = openssl_fopen(ptr, p); if (fp == NULL) { - SYSerr(SYS_F_FOPEN, get_last_sys_error()); + SYSerr("fopen", get_last_sys_error()); ERR_add_error_data(5, "fopen('", ptr, "','", p, "')"); BIOerr(BIO_F_FILE_CTRL, ERR_R_SYS_LIB); ret = 0; @@ -316,7 +316,7 @@ 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) { - SYSerr(SYS_F_FFLUSH, get_last_sys_error()); + SYSerr("fflush", get_last_sys_error()); ERR_add_error_data(1, "fflush()"); BIOerr(BIO_F_FILE_CTRL, ERR_R_SYS_LIB); ret = 0; |