]> git.armaanb.net Git - stagit.git/commitdiff
more verbose errors: show which file failed on open
authorHiltjo Posthuma <hiltjo@codemadness.org>
Fri, 10 Nov 2017 19:53:46 +0000 (20:53 +0100)
committerHiltjo Posthuma <hiltjo@codemadness.org>
Fri, 10 Nov 2017 19:53:46 +0000 (20:53 +0100)
stagit.c

index 4e046fd326d2b49dd9782f3778ea674a15ccae95..43cd2ef605cbbf537a8052dee3ecd7fbd55d083a 100644 (file)
--- a/stagit.c
+++ b/stagit.c
@@ -223,7 +223,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;
 }
@@ -1115,7 +1115,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);