Use strerror() - dedup - deduplicating backup program
 (HTM) git clone git://bitreich.org/dedup/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/dedup/
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) Tags
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 81c2c0671a98a4ff22a1d95fd302e6a3c35898a8
 (DIR) parent a2ee78a3a3866e2ef605ca45263c14079c808d56
 (HTM) Author: sin <sin@2f30.org>
       Date:   Fri,  3 May 2019 16:32:29 +0100
       
       Use strerror()
       
       Diffstat:
         M bstorage.c                          |       5 +++--
         M snap.c                              |       5 +++--
       
       2 files changed, 6 insertions(+), 4 deletions(-)
       ---
 (DIR) 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;
                }
        
 (DIR) 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;
                }