Use strerror() in block.c - dedup - deduplicating backup program HTML git clone git://bitreich.org/dedup/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/dedup/ DIR Log DIR Files DIR Refs DIR Tags DIR README DIR LICENSE --- DIR commit 78ad139e2acc136eef7c94ff566a1150a9fdfb5b DIR parent 7e9bd31a78b71aa5451f66808fd57f7eabb4e811 HTML Author: sin <sin@2f30.org> Date: Fri, 3 May 2019 16:41:49 +0100 Use strerror() in block.c Diffstat: M block.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- DIR diff --git a/block.c b/block.c @@ -2,6 +2,7 @@ #include <sys/types.h> #include <sys/stat.h> +#include <errno.h> #include <fcntl.h> #include <stdarg.h> #include <stdint.h> @@ -29,7 +30,7 @@ bcreat(char *path, int mode, struct bparam *bpar, struct bctx **bctx) *bctx = calloc(1, sizeof(**bctx)); if (*bctx == NULL) { - bseterr("out of memory"); + bseterr("calloc: %s", strerror(errno)); return -1; } @@ -53,7 +54,7 @@ bopen(char *path, int flags, int mode, struct bparam *bpar, struct bctx **bctx) *bctx = calloc(1, sizeof(**bctx)); if (*bctx == NULL) { - bseterr("out of memory"); + bseterr("calloc: %s", strerror(errno)); return -1; }