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>
Jens Axboe committed
Oct 20, 2005 at 00:52 UTC
7872e0556746c70e49c5558d271d35b1fbfb1680
1 file changed
+1
-1
daemon.c
+1
-1
@@ -533,7 +533,7 @@ static int service_loop(int socknum, int *socklist)
533
for (;;) {
534
int i;
535
536
- if (poll(pfd, socknum, 0) < 0) {
536
+ if (poll(pfd, socknum, -1) < 0) {
537
if (errno != EINTR) {
538
error("poll failed, resuming: %s",
539
strerror(errno));