[PATCH] Possible cleanups for local-pull.c
[gitweb.git] / daemon.c
index b7d60918ebab7816d8711b927aeae7dfab32fd2e..fb3f25c48665596f41ebcee66037bdd1be2dd30a 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -3,6 +3,7 @@
 #include <signal.h>
 #include <sys/wait.h>
 #include <sys/socket.h>
+#include <sys/time.h>
 #include <netdb.h>
 #include <netinet/in.h>
 
@@ -294,8 +295,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;
                }