From 957b11334a7afb14537322f0e4795b2e368b3f59 Mon Sep 17 00:00:00 2001 From: beck <> Date: Sun, 29 Jan 2017 17:49:23 +0000 Subject: Send the function codes from the error functions to the bit bucket, as was done earlier in libssl. Thanks inoguchi@ for noticing libssl had more reacharounds into this. ok jsing@ inoguchi@ --- src/lib/libcrypto/bio/bss_file.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/lib/libcrypto/bio/bss_file.c') diff --git a/src/lib/libcrypto/bio/bss_file.c b/src/lib/libcrypto/bio/bss_file.c index c710076fea..01f4a3ff3b 100644 --- a/src/lib/libcrypto/bio/bss_file.c +++ b/src/lib/libcrypto/bio/bss_file.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bss_file.c,v 1.31 2014/11/11 19:26:12 miod Exp $ */ +/* $OpenBSD: bss_file.c,v 1.32 2017/01/29 17:49:22 beck Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -119,12 +119,12 @@ BIO_new_file(const char *filename, const char *mode) file = fopen(filename, mode); if (file == NULL) { - SYSerr(SYS_F_FOPEN, errno); + SYSerror(errno); ERR_asprintf_error_data("fopen('%s', '%s')", filename, mode); if (errno == ENOENT) - BIOerr(BIO_F_BIO_NEW_FILE, BIO_R_NO_SUCH_FILE); + BIOerror(BIO_R_NO_SUCH_FILE); else - BIOerr(BIO_F_BIO_NEW_FILE, ERR_R_SYS_LIB); + BIOerror(ERR_R_SYS_LIB); return (NULL); } if ((ret = BIO_new(BIO_s_file())) == NULL) { @@ -188,8 +188,8 @@ file_read(BIO *b, char *out, int outl) if (b->init && out != NULL) { ret = fread(out, 1, outl, (FILE *)b->ptr); if (ret == 0 && ferror((FILE *)b->ptr)) { - SYSerr(SYS_F_FREAD, errno); - BIOerr(BIO_F_FILE_READ, ERR_R_SYS_LIB); + SYSerror(errno); + BIOerror(ERR_R_SYS_LIB); ret = -1; } } @@ -246,15 +246,15 @@ file_ctrl(BIO *b, int cmd, long num, void *ptr) else if (num & BIO_FP_READ) strlcpy(p, "r", sizeof p); else { - BIOerr(BIO_F_FILE_CTRL, BIO_R_BAD_FOPEN_MODE); + BIOerror(BIO_R_BAD_FOPEN_MODE); ret = 0; break; } fp = fopen(ptr, p); if (fp == NULL) { - SYSerr(SYS_F_FOPEN, errno); + SYSerror(errno); ERR_asprintf_error_data("fopen('%s', '%s')", ptr, p); - BIOerr(BIO_F_FILE_CTRL, ERR_R_SYS_LIB); + BIOerror(ERR_R_SYS_LIB); ret = 0; break; } -- cgit v1.2.3-55-g6feb