diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-05-26 10:27:55 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-05-26 10:27:55 -0700 |
commit | 34df9fe36a3627e1c2a9ae244820fb61e3891b90 (patch) | |
tree | d33bcbf6d1cbc2512d1cbffa0a36bbfdf6bae991 | |
parent | 420147290dc6f96d5007da7a089ab2ac9f1e99d4 (diff) | |
parent | 1c1f046c43d3bb9ba2c094bbe2e87df833b71508 (diff) | |
download | git-34df9fe36a3627e1c2a9ae244820fb61e3891b90.tar.gz |
Merge branch 'js/maint-send-pack-stateless-rpc-deadlock-fix' into maint-1.7.4
* 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
-rw-r--r-- | builtin/send-pack.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/builtin/send-pack.c b/builtin/send-pack.c index 2cd1c40b70..eb38ab4e01 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; |