Re: [msysGit] [PATCH/RFC 08/11] daemon: use explicit file descriptor
From: Johannes Sixt <hidden>
Date: 2016-06-15 22:47:47
On Freitag, 27. November 2009, Erik Faye-Lund wrote:
On Fri, Nov 27, 2009 at 3:23 PM, Erik Faye-Lund [off-list ref] wrote:quoted
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