[PATCH] Add a new extended SHA1 syntax <name>~<num>
[gitweb.git] / daemon.c
index eeff9e7b05fc9e84f8fef06a5322f9fbb3ec9eb2..932d908bad3587b8ae7868112d587eaca775a303 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -71,13 +71,13 @@ static int max_connections = 25;
 
 /* These are updated by the signal handler */
 static volatile unsigned int children_reaped = 0;
-pid_t dead_child[MAX_CHILDREN];
+static pid_t dead_child[MAX_CHILDREN];
 
 /* These are updated by the main loop */
 static unsigned int children_spawned = 0;
 static unsigned int children_deleted = 0;
 
-struct child {
+static struct child {
        pid_t pid;
        socklen_t addrlen;
        struct sockaddr_storage address;
@@ -294,8 +294,11 @@ static int serve(int port)
                fds = fds_init;
                
                if (select(maxfd + 1, &fds, NULL, NULL, NULL) < 0) {
-                       error("select failed, resuming: %s", strerror(errno));
-                       sleep(1);
+                       if (errno != EINTR) {
+                               error("select failed, resuming: %s",
+                                     strerror(errno));
+                               sleep(1);
+                       }
                        continue;
                }