diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-04-23 11:16:50 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-23 11:16:50 -0700 |
commit | f87f7424df3e3fba0b0211c9a7fe78fe1e526802 (patch) | |
tree | 066878e0d905e1f92261231cd5ead72234878620 /builtin | |
parent | 118f60ee06612083ff4f1810424e80a3e896f73e (diff) | |
parent | 49ecfa13fe6fb9ccb7c4771126872515340c328b (diff) | |
download | git-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.c | 5 |
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)); |