summaryrefslogtreecommitdiff
path: root/builtin/send-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-05-13 18:02:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-05-13 18:02:29 (GMT)
commite9c1a3a426a4e93f093c79b31ec0b46064b6fb6e (patch)
tree160e2cbf79652729ca62a0c3133c8082994b5822 /builtin/send-pack.c
parentdf54e2bfd6afd0e7dcf5c658c92f469fdd1b06ff (diff)
parent80b5b6985510406dfb4016cada8013832078930c (diff)
downloadgit-e9c1a3a426a4e93f093c79b31ec0b46064b6fb6e.zip
git-e9c1a3a426a4e93f093c79b31ec0b46064b6fb6e.tar.gz
git-e9c1a3a426a4e93f093c79b31ec0b46064b6fb6e.tar.bz2
Merge branch 'js/maint-send-pack-stateless-rpc-deadlock-fix'
* js/maint-send-pack-stateless-rpc-deadlock-fix: 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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin/send-pack.c b/builtin/send-pack.c
index 8b0911c..4ac2ca9 100644
--- a/builtin/send-pack.c
+++ b/builtin/send-pack.c
@@ -229,6 +229,9 @@ static void print_helper_status(struct ref *ref)
static int sideband_demux(int in, int out, void *data)
{
int *fd = data;
+#ifdef NO_PTHREADS
+ close(fd[1]);
+#endif
int 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;