summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-04-23 11:16:50 -0700
committerJunio C Hamano <gitster@pobox.com>2013-04-23 11:16:50 -0700
commitf87f7424df3e3fba0b0211c9a7fe78fe1e526802 (patch)
tree066878e0d905e1f92261231cd5ead72234878620 /builtin
parent118f60ee06612083ff4f1810424e80a3e896f73e (diff)
parent49ecfa13fe6fb9ccb7c4771126872515340c328b (diff)
downloadgit-f87f7424df3e3fba0b0211c9a7fe78fe1e526802.tar.gz
Merge branch 'jk/receive-pack-deadlocks-with-early-failure'
When receive-pack detects error in the pack header it received in order to decide which of unpack-objects or index-pack to run, it returned without closing the error stream, which led to a hang sideband thread. * jk/receive-pack-deadlocks-with-early-failure: receive-pack: close sideband fd on early pack errors
Diffstat (limited to 'builtin')
-rw-r--r--builtin/receive-pack.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index ccebd74f16..e3eb5fc058 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -826,8 +826,11 @@ static const char *unpack(int err_fd)
: 0);
hdr_err = parse_pack_header(&hdr);
- if (hdr_err)
+ if (hdr_err) {
+ if (err_fd > 0)
+ close(err_fd);
return hdr_err;
+ }
snprintf(hdr_arg, sizeof(hdr_arg),
"--pack_header=%"PRIu32",%"PRIu32,
ntohl(hdr.hdr_version), ntohl(hdr.hdr_entries));