tUse strerror() in block.c - dedup - deduplicating backup program
(HTM) git clone git://git.z3bra.org/dedup.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 78ad139e2acc136eef7c94ff566a1150a9fdfb5b
(DIR) parent 7e9bd31a78b71aa5451f66808fd57f7eabb4e811
(HTM) 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
t@@ -2,6 +2,7 @@
#include <sys/types.h>
#include <sys/stat.h>
+#include <errno.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdint.h>
t@@ -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;
}
t@@ -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;
}