ignore EINTR

This commit is contained in:
wangyu- 2017-11-24 00:28:47 -06:00
parent ee9dab37fa
commit 08f2b5d405

View File

@ -705,9 +705,18 @@ int event_loop()
int nfds = epoll_wait(epollfd, events, max_events, 180 * 1000); //3mins int nfds = epoll_wait(epollfd, events, max_events, 180 * 1000); //3mins
if (nfds < 0) if (nfds < 0)
{ {
mylog(log_fatal,"epoll_wait return %d\n", nfds); 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); myexit(-1);
} }
}
int n; int n;
int clear_triggered=0; int clear_triggered=0;
for (n = 0; n < nfds; ++n) for (n = 0; n < nfds; ++n)