[sheepdog] [PATCH] event: use specified timeiout for epoll_wait

MORITA Kazutaka morita.kazutaka at gmail.com
Wed May 15 18:40:24 CEST 2013


From: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>

There is no need to wait 1 second every time.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 lib/event.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/event.c b/lib/event.c
index 5b15925..becacd7 100644
--- a/lib/event.c
+++ b/lib/event.c
@@ -24,8 +24,6 @@
 static int efd;
 static LIST_HEAD(events_list);
 
-#define TICK 1
-
 static void timer_handler(int fd, int events, void *data)
 {
 	struct timer *t = data;
@@ -194,7 +192,7 @@ static void do_event_loop(int timeout, bool sort_with_prio)
 	int i, nr;
 
 refresh:
-	nr = epoll_wait(efd, events, nr_events, TICK * 1000);
+	nr = epoll_wait(efd, events, nr_events, timeout);
 	if (sort_with_prio)
 		qsort(events, nr, sizeof(struct epoll_event), epoll_event_cmp);
 
-- 
1.7.9.5




More information about the sheepdog mailing list