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>
This commit is contained in:
Jens Axboe 2005-10-20 00:52:32 -07:00 committed by Junio C Hamano
parent bfadbeddd1
commit 7872e05567

View file

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