summaryrefslogtreecommitdiff
path: root/builtin/send-pack.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2011-05-26 09:32:14 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-05-26 09:32:14 -0700
commitf09937de964bb30e0614123daa9051afbffb4408 (patch)
tree6f12938a83b7226204a9903cedef1b963ab6d323 /builtin/send-pack.c
parentMerge branch 'svn-fe-maint' of git://repo.or.cz/git/jrn into maint (diff)
parentMerge branch 'js/maint-1.6.6-send-pack-stateless-rpc-deadlock-fix' into js/ma... (diff)
downloadtgif-f09937de964bb30e0614123daa9051afbffb4408.tar.xz
Merge branch 'js/maint-send-pack-stateless-rpc-deadlock-fix' into maint
* js/maint-send-pack-stateless-rpc-deadlock-fix: sideband_demux(): fix decl-after-stmt send-pack: unbreak push over stateless rpc send-pack: avoid deadlock when pack-object dies early
Diffstat (limited to 'builtin/send-pack.c')
-rw-r--r--builtin/send-pack.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/builtin/send-pack.c b/builtin/send-pack.c
index 8b0911c0d2..e6a3495e1c 100644
--- a/builtin/send-pack.c
+++ b/builtin/send-pack.c
@@ -228,8 +228,11 @@ static void print_helper_status(struct ref *ref)
static int sideband_demux(int in, int out, void *data)
{
- int *fd = data;
- int ret = recv_sideband("send-pack", fd[0], out);
+ int *fd = data, ret;
+#ifdef NO_PTHREADS
+ close(fd[1]);
+#endif
+ ret = recv_sideband("send-pack", fd[0], out);
close(out);
return ret;
}
@@ -339,6 +342,8 @@ int send_pack(struct send_pack_args *args,
if (pack_objects(out, remote_refs, extra_have, args) < 0) {
for (ref = remote_refs; ref; ref = ref->next)
ref->status = REF_STATUS_NONE;
+ if (args->stateless_rpc)
+ close(out);
if (use_sideband)
finish_async(&demux);
return -1;