]> git.scripts.mit.edu Git - git.git/blobdiff - daemon.c
interpret_branch_name: always respect "namelen" parameter
[git.git] / daemon.c
index 6aeddcb98d2694a705d34e80293fc81a20bc39a8..13608c07c674171ace754154c5d1cb7dea6c5e04 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -760,7 +760,7 @@ static void handle(int incoming, struct sockaddr *addr, socklen_t addrlen)
                snprintf(portbuf, sizeof(portbuf), "REMOTE_PORT=%d",
                    ntohs(sin_addr->sin_port));
 #ifndef NO_IPV6
-       } else if (addr && addr->sa_family == AF_INET6) {
+       } else if (addr->sa_family == AF_INET6) {
                struct sockaddr_in6 *sin6_addr = (void *) addr;
 
                char *buf = addrbuf + 12;
@@ -1047,18 +1047,6 @@ static int service_loop(struct socketlist *socklist)
        }
 }
 
-/* if any standard file descriptor is missing open it to /dev/null */
-static void sanitize_stdfds(void)
-{
-       int fd = open("/dev/null", O_RDWR, 0);
-       while (fd != -1 && fd < 2)
-               fd = dup(fd);
-       if (fd == -1)
-               die_errno("open /dev/null or dup failed");
-       if (fd > 2)
-               close(fd);
-}
-
 #ifdef NO_POSIX_GOODIES
 
 struct credentials;
@@ -1290,11 +1278,11 @@ int main(int argc, char **argv)
                        make_service_overridable(arg + 18, 0);
                        continue;
                }
-               if (!prefixcmp(arg, "--informative-errors")) {
+               if (!strcmp(arg, "--informative-errors")) {
                        informative_errors = 1;
                        continue;
                }
-               if (!prefixcmp(arg, "--no-informative-errors")) {
+               if (!strcmp(arg, "--no-informative-errors")) {
                        informative_errors = 0;
                        continue;
                }