summaryrefslogtreecommitdiff
path: root/builtin/am.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2016-05-08 09:47:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-05-09 19:29:08 (GMT)
commit6e59e9c0a658c619d390ed93466e457d4b80f0fe (patch)
tree56635d755a30f97806ab3e19856b3fa1671d3066 /builtin/am.c
parent23e7a312e115e4cbeda3d944b8020e014f0f908a (diff)
downloadgit-6e59e9c0a658c619d390ed93466e457d4b80f0fe.zip
git-6e59e9c0a658c619d390ed93466e457d4b80f0fe.tar.gz
git-6e59e9c0a658c619d390ed93466e457d4b80f0fe.tar.bz2
builtin/am.c: use error_errno()
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/am.c')
-rw-r--r--builtin/am.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/builtin/am.c b/builtin/am.c
index d003939..3dfe70b 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -769,15 +769,15 @@ static int split_mail_conv(mail_conv_fn fn, struct am_state *state,
in = fopen(*paths, "r");
if (!in)
- return error(_("could not open '%s' for reading: %s"),
- *paths, strerror(errno));
+ return error_errno(_("could not open '%s' for reading"),
+ *paths);
mail = mkpath("%s/%0*d", state->dir, state->prec, i + 1);
out = fopen(mail, "w");
if (!out)
- return error(_("could not open '%s' for writing: %s"),
- mail, strerror(errno));
+ return error_errno(_("could not open '%s' for writing"),
+ mail);
ret = fn(out, in, keep_cr);
@@ -857,8 +857,7 @@ static int split_mail_stgit_series(struct am_state *state, const char **paths,
fp = fopen(*paths, "r");
if (!fp)
- return error(_("could not open '%s' for reading: %s"), *paths,
- strerror(errno));
+ return error_errno(_("could not open '%s' for reading"), *paths);
while (!strbuf_getline_lf(&sb, fp)) {
if (*sb.buf == '#')