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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Sun, 11 Mar 2007, H. Peter Anvin wrote:

> Johannes Schindelin wrote:
> > 
> > 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]);?

Yes, of course!

> > @@ -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...

I didn't know that, but that makes sense.

Ciao,
Dscho

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]