[PATCH] daemon: restore getpeername(0,...) use

2012-09-08 Thread Jan Engelhardt
This reverts f9c87be6b42dd0f8b31a4bb8c6a44326879fdd1a, in a sense, because that commit broke logging of "Connection from ..." when git-daemon is run under xinetd. This patch here computes the text representation of the peer and then copies that to environment variables such that the code in execut

Re: [PATCH] daemon: restore getpeername(0,...) use

2012-09-08 Thread Joachim Schmitz
Jan Engelhardt wrote: This reverts f9c87be6b42dd0f8b31a4bb8c6a44326879fdd1a, in a sense, because that commit broke logging of "Connection from ..." when git-daemon is run under xinetd. This patch here computes the text representation of the peer and then copies that to environment variables such

Re: [PATCH] daemon: restore getpeername(0,...) use

2012-09-08 Thread Junio C Hamano
Jan Engelhardt writes: > This reverts f9c87be6b42dd0f8b31a4bb8c6a44326879fdd1a, in a sense, > because that commit broke logging of "Connection from ..." when > git-daemon is run under xinetd. > > This patch here computes the text representation of the peer and then > copies that to environment va

Re: [PATCH] daemon: restore getpeername(0,...) use

2012-09-08 Thread Junio C Hamano
"Joachim Schmitz" writes: >> + setenv("REMOTE_PORT", portbuf, true); > > setenv() is not a function available on all plattfomrs. Please do some homework before adding irrelevant noise. At the minimum, run "git grep" to see if we already use it in other places, and investigate why we can use it

RE: [PATCH] daemon: restore getpeername(0,...) use

2012-09-08 Thread Joachim Schmitz
> From: Junio C Hamano [mailto:gits...@pobox.com] > Sent: Saturday, September 08, 2012 9:04 PM > To: Joachim Schmitz > Cc: git@vger.kernel.org > Subject: Re: [PATCH] daemon: restore getpeername(0,...) use > > "Joachim Schmitz" writes: > > >

Re: [PATCH] daemon: restore getpeername(0,...) use

2012-09-08 Thread Jan Engelhardt
On Saturday 2012-09-08 20:59, Junio C Hamano wrote: >> diff --git a/daemon.c b/daemon.c >> index 4602b46..eaf08c2 100644 >> --- a/daemon.c >> +++ b/daemon.c >> @@ -1,3 +1,4 @@ >> +#include >> #include "cache.h" >> #include "pkt-line.h" >> #include "exec_cmd.h" > >Platform agnostic parts of the

Re: [PATCH] daemon: restore getpeername(0,...) use

2012-09-10 Thread Jeff King
On Sat, Sep 08, 2012 at 09:20:48PM +0200, Jan Engelhardt wrote: > On Saturday 2012-09-08 20:59, Junio C Hamano wrote: > >> diff --git a/daemon.c b/daemon.c > >> index 4602b46..eaf08c2 100644 > >> --- a/daemon.c > >> +++ b/daemon.c > >> @@ -1,3 +1,4 @@ > >> +#include > >> #include "cache.h" > >>

Re: [PATCH] daemon: restore getpeername(0,...) use

2012-09-10 Thread Joachim Schmitz
Jeff King wrote: On Sat, Sep 08, 2012 at 09:20:48PM +0200, Jan Engelhardt wrote: On Saturday 2012-09-08 20:59, Junio C Hamano wrote: diff --git a/daemon.c b/daemon.c index 4602b46..eaf08c2 100644 --- a/daemon.c +++ b/daemon.c @@ -1,3 +1,4 @@ +#include #include "cache.h" #include "pkt-line.h

Re: [PATCH] daemon: restore getpeername(0,...) use

2012-09-10 Thread Jeff King
On Mon, Sep 10, 2012 at 04:38:58PM +0200, Joachim Schmitz wrote: > >More importantly, though, is it actually portable? I thought it was > >added in C99, and we try to stick to C89 to support older compilers > >and systems. My copy of C99 is vague (it says only that the "bool" > >macro was added vi

Re: [PATCH] daemon: restore getpeername(0,...) use

2012-09-10 Thread Joachim Schmitz
Jeff King wrote: On Mon, Sep 10, 2012 at 04:38:58PM +0200, Joachim Schmitz wrote: More importantly, though, is it actually portable? I thought it was added in C99, and we try to stick to C89 to support older compilers and systems. My copy of C99 is vague (it says only that the "bool" macro was

Re: [PATCH] daemon: restore getpeername(0,...) use

2012-09-10 Thread Jeff King
On Mon, Sep 10, 2012 at 07:26:26PM +0200, Joachim Schmitz wrote: > >>as are non-const array intializers, e.g.: > >> > >> const char *args[] = { editor, path, NULL }; > >> ^ > >>".../git/editor.c", line 39: error(122): expression must have

RE: [PATCH] daemon: restore getpeername(0,...) use

2012-09-10 Thread Joachim Schmitz
> From: Jeff King [mailto:p...@peff.net] > Sent: Monday, September 10, 2012 7:59 PM > To: Joachim Schmitz > Cc: git@vger.kernel.org > Subject: Re: [PATCH] daemon: restore getpeername(0,...) use > > On Mon, Sep 10, 2012 at 07:26:26PM +0200, Joachim Schmitz wrote: > >

Re: [PATCH] daemon: restore getpeername(0,...) use

2012-09-10 Thread Jeff King
On Mon, Sep 10, 2012 at 08:27:07PM +0200, Joachim Schmitz wrote: > > I think it is a mistake to set -std=c89 (or whatever similar option your > > compiler supports). Like I said, we are not interested in being strictly > > C89-compliant. We are interested in working on real-world systems. > > > >