Merge branch 'fixes'
[git.git] / daemon.c
index 6298f53..11fa3ed 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -142,7 +142,7 @@ static int upload(char *dir, int dirlen)
         * is ok with us doing this.
         */
        if ((!export_all_trees && access("git-daemon-export-ok", F_OK)) ||
-           access("objects/00", X_OK) ||
+           access("objects/", X_OK) ||
            access("HEAD", R_OK)) {
                logerror("Not a valid git-daemon-enabled repository: '%s'", dir);
                return -1;
@@ -480,6 +480,8 @@ static int service_loop(int socknum, int *socklist)
                pfd[i].fd = socklist[i];
                pfd[i].events = POLLIN;
        }
+
+       signal(SIGCHLD, child_handler);
        
        for (;;) {
                int i;
@@ -496,7 +498,7 @@ static int service_loop(int socknum, int *socklist)
                for (i = 0; i < socknum; i++) {
                        if (pfd[i].revents & POLLIN) {
                                struct sockaddr_storage ss;
-                               int sslen = sizeof(ss);
+                               unsigned int sslen = sizeof(ss);
                                int incoming = accept(pfd[i].fd, (struct sockaddr *)&ss, &sslen);
                                if (incoming < 0) {
                                        switch (errno) {
@@ -518,8 +520,6 @@ static int serve(int port)
 {
        int socknum, *socklist;
        
-       signal(SIGCHLD, child_handler);
-       
        socknum = socksetup(port, &socklist);
        if (socknum == 0)
                die("unable to allocate any listen sockets on port %u", port);