connected.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
5cc026e218d0ad3962d10c0775fe9b5ac68eed09
1 file changed
+3
-6
connected.c
+3
-6
@@ -86,17 +86,14 @@ static int check_everything_connected_real(sha1_iterate_fn fn,
86
memcpy(commit, sha1_to_hex(sha1), 40);
87
if (write_in_full(rev_list.in, commit, 41) < 0) {
88
if (errno != EPIPE && errno != EINVAL)
89
- error(_("failed write to rev-list: %s"),
90
- strerror(errno));
89
+ error_errno(_("failed write to rev-list"));
90
err = -1;
91
break;
92
}
93
} while (!fn(cb_data, sha1));
94
96
- if (close(rev_list.in)) {
97
- error(_("failed to close rev-list's stdin: %s"), strerror(errno));
98
- err = -1;
99
- }
95
+ if (close(rev_list.in))
96
+ err = error_errno(_("failed to close rev-list's stdin"));
97
98
sigchain_pop(SIGPIPE);
99
return finish_command(&rev_list) || err;