transport-helper.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:

committed by
Junio C Hamano

parent
7616c6ca9d
commit
1fee1dce71
@ -1166,7 +1166,7 @@ static int udt_do_read(struct unidirectional_transfer *t)
|
|||||||
bytes = read(t->src, t->buf + t->bufuse, BUFFERSIZE - t->bufuse);
|
bytes = read(t->src, t->buf + t->bufuse, BUFFERSIZE - t->bufuse);
|
||||||
if (bytes < 0 && errno != EWOULDBLOCK && errno != EAGAIN &&
|
if (bytes < 0 && errno != EWOULDBLOCK && errno != EAGAIN &&
|
||||||
errno != EINTR) {
|
errno != EINTR) {
|
||||||
error("read(%s) failed: %s", t->src_name, strerror(errno));
|
error_errno("read(%s) failed", t->src_name);
|
||||||
return -1;
|
return -1;
|
||||||
} else if (bytes == 0) {
|
} else if (bytes == 0) {
|
||||||
transfer_debug("%s EOF (with %i bytes in buffer)",
|
transfer_debug("%s EOF (with %i bytes in buffer)",
|
||||||
@ -1193,7 +1193,7 @@ static int udt_do_write(struct unidirectional_transfer *t)
|
|||||||
transfer_debug("%s is writable", t->dest_name);
|
transfer_debug("%s is writable", t->dest_name);
|
||||||
bytes = xwrite(t->dest, t->buf, t->bufuse);
|
bytes = xwrite(t->dest, t->buf, t->bufuse);
|
||||||
if (bytes < 0 && errno != EWOULDBLOCK) {
|
if (bytes < 0 && errno != EWOULDBLOCK) {
|
||||||
error("write(%s) failed: %s", t->dest_name, strerror(errno));
|
error_errno("write(%s) failed", t->dest_name);
|
||||||
return -1;
|
return -1;
|
||||||
} else if (bytes > 0) {
|
} else if (bytes > 0) {
|
||||||
t->bufuse -= bytes;
|
t->bufuse -= bytes;
|
||||||
@ -1306,7 +1306,7 @@ static int tloop_join(pid_t pid, const char *name)
|
|||||||
{
|
{
|
||||||
int tret;
|
int tret;
|
||||||
if (waitpid(pid, &tret, 0) < 0) {
|
if (waitpid(pid, &tret, 0) < 0) {
|
||||||
error("%s process failed to wait: %s", name, strerror(errno));
|
error_errno("%s process failed to wait", name);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (!WIFEXITED(tret) || WEXITSTATUS(tret)) {
|
if (!WIFEXITED(tret) || WEXITSTATUS(tret)) {
|
||||||
|
Reference in New Issue
Block a user