summaryrefslogtreecommitdiff
path: root/daemon.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@suse.de>2005-10-20 00:52:32 -0700
committerJunio C Hamano <junkio@cox.net>2005-10-20 21:26:31 -0700
commit7872e0556746c70e49c5558d271d35b1fbfb1680 (patch)
tree6602922af56bd2f9f85ba2030651f751e93ad20d /daemon.c
parentbfadbeddd1b54af8ab08a6c556c43c756ec85588 (diff)
downloadgit-7872e0556746c70e49c5558d271d35b1fbfb1680.tar.gz
git-daemon poll() spinning out of control
With the '0' timeout given to poll, it returns instantly without any events on my system, causing git-daemon to consume all the CPU time. Use -1 as the timeout so poll() only returns in case of EINTR or actually events being available. Signed-off-by: Jens Axboe <axboe@suse.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'daemon.c')
-rw-r--r--daemon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/daemon.c b/daemon.c
index c3381b344c..b3bcd7a60a 100644
--- a/daemon.c
+++ b/daemon.c
@@ -533,7 +533,7 @@ static int service_loop(int socknum, int *socklist)
for (;;) {
int i;
- if (poll(pfd, socknum, 0) < 0) {
+ if (poll(pfd, socknum, -1) < 0) {
if (errno != EINTR) {
error("poll failed, resuming: %s",
strerror(errno));