summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bfadbed)
raw | patch | inline | side by side (parent: bfadbed)
author | Jens Axboe <axboe@suse.de> | |
Thu, 20 Oct 2005 07:52:32 +0000 (00:52 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 21 Oct 2005 04:26:31 +0000 (21:26 -0700) |
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>
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>
daemon.c | patch | blob | history |
diff --git a/daemon.c b/daemon.c
index c3381b344ccbeff2f13a52c83f17b9960798d8c3..b3bcd7a60a9281e16a15d4e8f73bb73c73fd5c7f 100644 (file)
--- a/daemon.c
+++ b/daemon.c
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));