[Sheepdog] [PATCH] retry epoll_wait when errno is EINTR

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Tue Jul 6 09:46:04 CEST 2010


Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 lib/event.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/lib/event.c b/lib/event.c
index 6991b6c..a02053f 100644
--- a/lib/event.c
+++ b/lib/event.c
@@ -172,6 +172,8 @@ void event_loop(int timeout)
 
 	nr = epoll_wait(efd, events, ARRAY_SIZE(events), TICK * 1000);
 	if (nr < 0) {
+		if (errno == EINTR)
+			return;
 		eprintf("epoll_wait failed, %m\n");
 		exit(1);
 	} else if (nr) {
-- 
1.5.6.5




More information about the sheepdog mailing list