THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Browse Source

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 <junkio@cox.net>
tags/v0.99.4
Junio C Hamano 14 years ago
parent
commit
1eef0b33c6
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      daemon.c

+ 5
- 2
daemon.c View File

@@ -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;
}



Loading…
Cancel
Save