From 76d0af5599554d11f104d582cdac8fbaa8569fcc Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 4 Mar 2016 23:50:00 +0100 Subject: Clean up, add zerror and zperror, fix bugs and add more tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/zperror.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/zperror.c (limited to 'src/zperror.c') diff --git a/src/zperror.c b/src/zperror.c new file mode 100644 index 0000000..37bd5c7 --- /dev/null +++ b/src/zperror.c @@ -0,0 +1,17 @@ +/* See LICENSE file for copyright and license details. */ +#include "internals.h" + +#include + + +void +zperror(const char *prefix) +{ + if (libzahl_error >= 0) { + errno = libzahl_error; + perror(prefix); + } else { + /* Current, we should not be able to get here. */ + abort(); + } +} -- cgit v1.2.3-70-g09d2