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>
Nguyễn Thái Ngọc Duy committed
May 8, 2016 at 16:47 UTC
6e59e9c0a658c619d390ed93466e457d4b80f0fe
1 file changed
+5
-6
builtin/am.c
+5
-6
@@ -769,15 +769,15 @@ static int split_mail_conv(mail_conv_fn fn, struct am_state *state,
769
in = fopen(*paths, "r");
770
771
if (!in)
772
- return error(_("could not open '%s' for reading: %s"),
773
- *paths, strerror(errno));
772
+ return error_errno(_("could not open '%s' for reading"),
773
+ *paths);
774
775
mail = mkpath("%s/%0*d", state->dir, state->prec, i + 1);
776
777
out = fopen(mail, "w");
778
if (!out)
779
- return error(_("could not open '%s' for writing: %s"),
780
- mail, strerror(errno));
779
+ return error_errno(_("could not open '%s' for writing"),
780
+ mail);
781
782
ret = fn(out, in, keep_cr);
783
@@ -857,8 +857,7 @@ static int split_mail_stgit_series(struct am_state *state, const char **paths,
857
858
fp = fopen(*paths, "r");
859
if (!fp)
860
- return error(_("could not open '%s' for reading: %s"), *paths,
861
- strerror(errno));
860
+ return error_errno(_("could not open '%s' for reading"), *paths);
861
862
while (!strbuf_getline_lf(&sb, fp)) {
863
if (*sb.buf == '#')