From 08f2b5d4056ac35ee67c21e3a5b93bfd85ad65b8 Mon Sep 17 00:00:00 2001 From: wangyu- Date: Fri, 24 Nov 2017 00:28:47 -0600 Subject: [PATCH] ignore EINTR --- main.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/main.cpp b/main.cpp index a5652b9..2ea1be5 100644 --- a/main.cpp +++ b/main.cpp @@ -705,8 +705,17 @@ int event_loop() int nfds = epoll_wait(epollfd, events, max_events, 180 * 1000); //3mins if (nfds < 0) { - mylog(log_fatal,"epoll_wait return %d\n", nfds); - myexit(-1); + if(errno==EINTR ) + { + mylog(log_info,"epoll interrupted by signal,continue\n"); + //myexit(0); + } + else + { + mylog(log_fatal,"epoll_wait return %d,%s\n", nfds,strerror(errno)); + myexit(-1); + } + } int n; int clear_triggered=0;