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 bdfe80d2e4f4fc13ad45bd35aeeeb3ec71422a4f..0747ce2a37ac90cd89044ab9e5aac688f0e1a269 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);
 
-               fclose(stderr); //FIXME: workaround
+               freopen("/dev/null", "w", stderr);
 
                if (getpeername(0, peer, &slen))
                        peer = NULL;