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>
This commit is contained in:
Nguyễn Thái Ngọc Duy 2016-05-08 16:47:39 +07:00 коммит произвёл Junio C Hamano
Родитель f0658ec9ea
Коммит 5cc026e218
1 изменённых файлов: 3 добавлений и 6 удалений

Просмотреть файл

@ -86,17 +86,14 @@ static int check_everything_connected_real(sha1_iterate_fn fn,
memcpy(commit, sha1_to_hex(sha1), 40); memcpy(commit, sha1_to_hex(sha1), 40);
if (write_in_full(rev_list.in, commit, 41) < 0) { if (write_in_full(rev_list.in, commit, 41) < 0) {
if (errno != EPIPE && errno != EINVAL) if (errno != EPIPE && errno != EINVAL)
error(_("failed write to rev-list: %s"), error_errno(_("failed write to rev-list"));
strerror(errno));
err = -1; err = -1;
break; break;
} }
} while (!fn(cb_data, sha1)); } while (!fn(cb_data, sha1));
if (close(rev_list.in)) { if (close(rev_list.in))
error(_("failed to close rev-list's stdin: %s"), strerror(errno)); err = error_errno(_("failed to close rev-list's stdin"));
err = -1;
}
sigchain_pop(SIGPIPE); sigchain_pop(SIGPIPE);
return finish_command(&rev_list) || err; return finish_command(&rev_list) || err;