Fix some tab/space inconsistencies in git-mergetool.sh
[gitweb.git] / daemon.c
index ab7a273859b66f5f2ae09deb0e2203121fb0c12e..b9ba44c582b3b6cfac0f150f7f8901d60b48bbb3 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -537,6 +537,10 @@ static int execute(struct sockaddr *addr)
 #endif
                }
                loginfo("Connection from %s:%d", addrbuf, port);
+               setenv("REMOTE_ADDR", addrbuf, 1);
+       }
+       else {
+               unsetenv("REMOTE_ADDR");
        }
 
        alarm(init_timeout ? init_timeout : timeout);
@@ -1083,7 +1087,8 @@ int main(int argc, char **argv)
                openlog("git-daemon", LOG_PID, LOG_DAEMON);
                set_die_routine(daemon_die);
        } else
-               setlinebuf(stderr); /* avoid splitting a message in the middle */
+               /* avoid splitting a message in the middle */
+               setvbuf(stderr, NULL, _IOLBF, 0);
 
        if (inetd_mode && (group_name || user_name))
                die("--user and --group are incompatible with --inetd");