aboutsummaryrefslogtreecommitdiff
path: root/upload-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-07-06 13:38:09 -0700
committerJunio C Hamano <gitster@pobox.com>2016-07-06 13:38:09 -0700
commit35d213c87ca7b46974decb53d9df2d363b707b50 (patch)
treece9e76af88e4b6a00db3c538bf07b2cc2ea25dcb /upload-pack.c
parent054d949ffb2e3aa98a97c564dc9c260e7fbab033 (diff)
parentfcf0fe9e698b7ec3de4e8565030886fc4e4a2757 (diff)
downloadgit-35d213c87ca7b46974decb53d9df2d363b707b50.tar.gz
git-35d213c87ca7b46974decb53d9df2d363b707b50.tar.xz
Merge branch 'lf/sideband-returns-void'
A small internal API cleanup. * lf/sideband-returns-void: upload-pack.c: make send_client_data() return void sideband.c: make send_sideband() return void
Diffstat (limited to 'upload-pack.c')
-rw-r--r--upload-pack.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/upload-pack.c b/upload-pack.c
index 9e03c278b..a86d49cfb 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -62,20 +62,21 @@ static void reset_timeout(void)
alarm(timeout);
}
-static ssize_t send_client_data(int fd, const char *data, ssize_t sz)
+static void send_client_data(int fd, const char *data, ssize_t sz)
{
- if (use_sideband)
- return send_sideband(1, fd, data, sz, use_sideband);
+ if (use_sideband) {
+ send_sideband(1, fd, data, sz, use_sideband);
+ return;
+ }
if (fd == 3)
/* emergency quit */
fd = 2;
if (fd == 2) {
/* XXX: are we happy to lose stuff here? */
xwrite(fd, data, sz);
- return sz;
+ return;
}
write_or_die(fd, data, sz);
- return sz;
}
static int write_one_shallow(const struct commit_graft *graft, void *cb_data)
@@ -233,9 +234,7 @@ static void create_pack_file(void)
}
else
buffered = -1;
- sz = send_client_data(1, data, sz);
- if (sz < 0)
- goto fail;
+ send_client_data(1, data, sz);
}
/*
@@ -262,9 +261,7 @@ static void create_pack_file(void)
/* flush the data */
if (0 <= buffered) {
data[0] = buffered;
- sz = send_client_data(1, data, 1);
- if (sz < 0)
- goto fail;
+ send_client_data(1, data, 1);
fprintf(stderr, "flushed.\n");
}
if (use_sideband)