more verbose errors: show which file failed on open - stagit-gopher - A git gopher frontend. (mirror)
 (HTM) git clone git://bitreich.org/stagit-gopher/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/stagit-gopher/
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) Tags
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 9420a097388c8c90a4f534d3b5f8d4f6b7f195bd
 (DIR) parent 2fc39b9cc9f90f20a6ef3c725080af1a0d5bc413
 (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
       Date:   Fri, 17 Nov 2017 16:09:55 +0100
       
       more verbose errors: show which file failed on open
       
       Diffstat:
         M stagit-gopher.c                     |       4 ++--
       
       1 file changed, 2 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/stagit-gopher.c b/stagit-gopher.c
       @@ -267,7 +267,7 @@ efopen(const char *name, const char *flags)
                FILE *fp;
        
                if (!(fp = fopen(name, flags)))
       -                err(1, "fopen");
       +                err(1, "fopen: '%s'", name);
        
                return fp;
        }
       @@ -1207,7 +1207,7 @@ main(int argc, char *argv[])
                        if ((fd = mkstemp(tmppath)) == -1)
                                err(1, "mkstemp");
                        if (!(wcachefp = fdopen(fd, "w")))
       -                        err(1, "fdopen");
       +                        err(1, "fdopen: '%s'", tmppath);
                        /* write last commit id (HEAD) */
                        git_oid_tostr(buf, sizeof(buf), head);
                        fprintf(wcachefp, "%s\n", buf);