more verbose errors: show which file failed on open - stagit-gopher - A git gop… | |
git clone git://bitreich.org/stagit-gopher/ git://enlrupgkhuxnvlhsf6lc3fziv5h2h… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
LICENSE | |
--- | |
commit 9420a097388c8c90a4f534d3b5f8d4f6b7f195bd | |
parent 2fc39b9cc9f90f20a6ef3c725080af1a0d5bc413 | |
Author: Hiltjo Posthuma <[email protected]> | |
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(-) | |
--- | |
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); |