git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-upload-pack: the timeout gets corrupted?!

From
HAH. Peter Anvin <hpa@zytor.com>
Date
Mar 11, 2007, 16:01 UTC
Message-ID
<45F427EA.8000905@zytor.com>
In-Reply-To
<Pine.LNX.4.63.0703111314150.22628@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin wrote:
Show 19 quoted lines
> 
> Something like this (totally untested):
> 
>  upload-pack.c |    6 ++++++
>  1 files changed, 6 insertions(+), 0 deletions(-)
> 
> diff --git a/upload-pack.c b/upload-pack.c
> index 498bf50..bafd90f 100644
> --- a/upload-pack.c
> +++ b/upload-pack.c
> @@ -119,6 +119,8 @@ static void create_pack_file(void)
>  		int i;
>  		struct rev_info revs;
>  
> +		close(0);
> +
>  		pack_pipe = fdopen(lp_pipe[1], "w");
>  
>  		if (create_full_pack)
Shouldn't that be close(lp_pipe[0]);?
Show 12 quoted lines
> @@ -167,6 +169,10 @@ static void create_pack_file(void)
>  		const char *argv[10];
>  		int i = 0;
>  
> +		close(0);
> +		close(1);
> +		close(2);
> +
>  		dup2(lp_pipe[0], 0);
>  		dup2(pu_pipe[1], 1);
>  		dup2(pe_pipe[1], 2);
> 
Those close()'s are redundant with the dup2's...
	-hpa
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 6 of 10 in “git-upload-pack: the timeout gets corrupted?!”
  1. H. Peter AnvinMar 11, 2007
  2. Junio C HamanoMar 11, 2007
  3. H. Peter AnvinMar 11, 2007
  4. H. Peter AnvinMar 11, 2007
  5. Johannes SchindelinMar 11, 2007
  6. H. Peter AnvinMar 11, 2007
  7. Johannes SchindelinMar 11, 2007
  8. H. Peter AnvinMar 11, 2007
  9. H. Peter AnvinMar 11, 2007
  10. H. Peter AnvinMar 11, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.