From: Johannes Sixt Date: Fri, 27 Nov 2009 20:23:45 GMT Subject: Re: [msysGit] [PATCH/RFC 08/11] daemon: use explicit file descriptor Message-ID: <200911272123.45163.j6t@kdbg.org> In-Reply-To: <40aa078e0911270746x55946f52qd76dc4f9443aebc6@mail.gmail.com> On Freitag, 27. November 2009, Erik Faye-Lund wrote: > On Fri, Nov 27, 2009 at 3:23 PM, Erik Faye-Lund > wrote: > > At the very least, I should remove the > > "dup2(incoming, 1)"-call, but I'm open to other suggestions. Perhaps I > > can change this patch to do the entire socket-passing (which is > > currently in the next patch)? No, an infrastructure change in a separate patch is good. > Something along these lines? > > ---8<--- > - cld.in = cld.out = fd; > + cld.in = dup(fd); > + cld.out = fd; >... > - dup2(incoming, 0); > - dup2(incoming, 1); > - close(incoming); > - > - exit(execute(0, addr)); > + exit(execute(incoming, addr)); > ---8<--- Yes, this looks very good. > When I think more about it, I might've broken the inetd-mode as it > should communicate over stdin and stdout (not just stdin as it would > try to do now)... I don't know the inetd internals, but this frightens > me a bit. Do we need inetd mode on Windows? At one time a looked for a inetd-like service, but couldn't find one. -- Hannes