Skip to content

Commit

Permalink
git-upload-pack: make sure we close unused pipe ends
Browse files Browse the repository at this point in the history
Right now, we don't close the read end of the pipe when git-upload-pack
runs git-pack-object, so we hang forever (why don't we get SIGALRM?)
instead of dying with SIGPIPE if the latter dies, which seems to be the
norm if the client disconnects.

Thanks to Johannes Schindelin <Johannes.Schindelin@gmx.de> for
pointing out where this close() needed to go.

This patch has been tested on kernel.org for several weeks and appear
to resolve the problem of git-upload-pack processes hanging around
forever.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
  • Loading branch information
H. Peter Anvin authored and Junio C Hamano committed Mar 28, 2007
1 parent 4621af3 commit 465b351
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions upload-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ static void create_pack_file(void)
int i;
struct rev_info revs;

close(lp_pipe[0]);
pack_pipe = fdopen(lp_pipe[1], "w");

if (create_full_pack)
Expand Down

0 comments on commit 465b351

Please sign in to comment.