{"thread":{"id":"7441","subject":"[PATCH] git-upload-pack: make sure we close unused pipe ends","startedAt":"2007-03-27T23:45:06Z","lastAt":"2007-03-27T23:45:06Z","messageCount":1,"participants":["H. Peter Anvin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"38204","messageId":"200703272347.l2RNln90025931@tazenda.hos.anvin.org","threadId":"7441","inReplyTo":null,"subject":"[PATCH] git-upload-pack: make sure we close unused pipe ends","fromName":"H. Peter Anvin","fromEmail":"hpa@zytor.com","sentAt":"2007-03-27T23:45:06Z","receivedAt":"2007-03-27T23:45:06Z","isPatch":true,"sender":{"key":"hpa@zytor.com","avatar":null},"body":"Right now, we don't close the read end of the pipe when git-upload-pack\nruns git-pack-object, so we hang forever (why don't we get SIGALRM?)\ninstead of dying with SIGPIPE if the latter dies, which seems to be the\nnorm if the client disconnects.\n\nThanks to Johannes Schindelin <Johannes.Schindelin@gmx.de> for\npointing out where this close() needed to go.\n\nThis patch has been tested on kernel.org for several weeks and appear\nto resolve the problem of git-upload-pack processes hanging around\nforever.\n\nSigned-off-by: H. Peter Anvin <hpa@zytor.com>\n---\n upload-pack.c |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/upload-pack.c b/upload-pack.c\nindex 498bf50..d3a09e7 100644\n--- a/upload-pack.c\n+++ b/upload-pack.c\n@@ -119,6 +119,7 @@ static void create_pack_file(void)\n \t\tint i;\n \t\tstruct rev_info revs;\n \n+\t\tclose(lp_pipe[0]);\n \t\tpack_pipe = fdopen(lp_pipe[1], \"w\");\n \n \t\tif (create_full_pack)\n-- \n1.5.0.3\n"}]}