Skip to content

Commit 73776dc

Browse files
committed
Merge branch 'js/maint-1.6.6-send-pack-stateless-rpc-deadlock-fix' into js/maint-send-pack-stateless-rpc-deadlock-fix
* js/maint-1.6.6-send-pack-stateless-rpc-deadlock-fix: send-pack: avoid deadlock when pack-object dies early Evil merge to adjust the way the use of pthreads in sideband-demultiplexor was decided (earlier it was "if we are not on Windows", now it is "if we are not using pthreads").
2 parents f6b6098 + 09c9957 commit 73776dc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

builtin-send-pack.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ static int pack_objects(int fd, struct ref *refs, struct extra_have_objects *ext
9898
free(buf);
9999
close(po.out);
100100
po.out = -1;
101+
close(fd);
101102
}
102103

103104
if (finish_command(&po))
@@ -226,6 +227,9 @@ static void print_helper_status(struct ref *ref)
226227
static int sideband_demux(int in, int out, void *data)
227228
{
228229
int *fd = data;
230+
#ifdef NO_PTHREADS
231+
close(fd[1]);
232+
#endif
229233
int ret = recv_sideband("send-pack", fd[0], out);
230234
close(out);
231235
return ret;

0 commit comments

Comments
 (0)