dedup

deduplicating backup program
git clone git://git.2f30.org/dedup
Log | Files | Refs | README | LICENSE

commit 81c2c0671a98a4ff22a1d95fd302e6a3c35898a8
parent a2ee78a3a3866e2ef605ca45263c14079c808d56
Author: sin <sin@2f30.org>
Date:   Fri,  3 May 2019 16:32:29 +0100

Use strerror()

Diffstat:
Mbstorage.c | 5+++--
Msnap.c | 5+++--
2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/bstorage.c b/bstorage.c @@ -13,6 +13,7 @@ #include <sys/stat.h> #include <assert.h> +#include <errno.h> #include <fcntl.h> #include <stdint.h> #include <stdio.h> @@ -313,7 +314,7 @@ bscreat(struct bctx *bctx, char *path, int mode, struct bparam *bpar) fd = open(path, O_RDWR | O_CREAT | O_EXCL, mode); if (fd < 0) { - bseterr("failed to open"); + bseterr("%s", strerror(errno)); return -1; } @@ -394,7 +395,7 @@ bsopen(struct bctx *bctx, char *path, int flags, int mode, struct bparam *bpar) fd = open(path, flags, mode); if (fd < 0) { - bseterr("failed to open"); + bseterr("%s", strerror(errno)); return -1; } diff --git a/snap.c b/snap.c @@ -2,6 +2,7 @@ #include <sys/types.h> #include <sys/stat.h> +#include <errno.h> #include <fcntl.h> #include <limits.h> #include <stdarg.h> @@ -91,7 +92,7 @@ screat(char *path, int mode, struct sctx **sctx) fd = open(path, O_RDWR | O_CREAT | O_EXCL, mode); if (fd < 0) { - sseterr("failed to open"); + sseterr("%s", strerror(errno)); return -1; } @@ -126,7 +127,7 @@ sopen(char *path, int flags, int mode, struct sctx **sctx) fd = open(path, O_RDONLY, mode); if (fd < 0) { - sseterr("failed to open"); + sseterr("%s", strerror(errno)); return -1; }