path: root/daemon.c
diff options
authorJunio C Hamano <>2005-07-26 20:26:52 (GMT)
committerJunio C Hamano <>2005-08-05 08:27:13 (GMT)
commit1eef0b33c6b33d9bc6fcce784b34599931256a36 (patch)
treeed66311e1b42d8bf9aee0d03b2383ac6e5e1aa3c /daemon.c
parent1215879cdcc508e30415e45ca2c8022f4f3976d6 (diff)
daemon.c: squelch error message from EINTR
Every time after servicing the connection, select() first fails with EINTR and ends up waiting for one second before serving the next client. The sleep() was placed by the original author per suggestion from the list to avoid spinning on failing select, but at least this EINTR situation should not result in "at most one client per second" service limit. I am not sure if this is the right fix, but WTH. The king penguin says that serious people would run the daemon under inetd anyway, and I agree with that. Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'daemon.c')
1 files changed, 5 insertions, 2 deletions
diff --git a/daemon.c b/daemon.c
index b7d6091..932d908 100644
--- a/daemon.c
+++ b/daemon.c
@@ -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);
+ }