daemon: send stderr to /dev/null instead of closing.
authorJunio C Hamano <junkio@cox.net>
Wed, 21 Jun 2006 23:37:48 +0000 (16:37 -0700)
committerJunio C Hamano <junkio@cox.net>
Wed, 21 Jun 2006 23:37:48 +0000 (16:37 -0700)
Signed-off-by: Junio C Hamano <junkio@cox.net>
daemon.c

index bdfe80d..0747ce2 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -757,7 +757,7 @@ int main(int argc, char **argv)
                struct sockaddr *peer = (struct sockaddr *)&ss;
                socklen_t slen = sizeof(ss);
 
                struct sockaddr *peer = (struct sockaddr *)&ss;
                socklen_t slen = sizeof(ss);
 
-               fclose(stderr); //FIXME: workaround
+               freopen("/dev/null", "w", stderr);
 
                if (getpeername(0, peer, &slen))
                        peer = NULL;
 
                if (getpeername(0, peer, &slen))
                        peer = NULL;