فهرست منبع

Log error when event polling function failed.

Tatsuhiro Tsujikawa 14 سال پیش
والد
کامیت
87ca37ea48
5فایلهای تغییر یافته به همراه16 افزوده شده و 2 حذف شده
  1. 4 1
      src/EpollEventPoll.cc
  2. 3 1
      src/KqueueEventPoll.cc
  3. 3 0
      src/PollEventPoll.cc
  4. 3 0
      src/PortEventPoll.cc
  5. 3 0
      src/SelectEventPoll.cc

+ 4 - 1
src/EpollEventPoll.cc

@@ -123,8 +123,11 @@ void EpollEventPoll::poll(const struct timeval& tv)
       KSocketEntry* p = reinterpret_cast<KSocketEntry*>(epEvents_[i].data.ptr);
       p->processEvents(epEvents_[i].events);
     }
+  } else if(res == -1) {
+    int errNum = errno;
+    A2_LOG_INFO(fmt("epoll_wait error: %s",
+                    util::safeStrerror(errNum).c_str()));
   }
-
 #ifdef ENABLE_ASYNC_DNS
   // It turns out that we have to call ares_process_fd before ares's
   // own timeout and ares may create new sockets or closes socket in

+ 3 - 1
src/KqueueEventPoll.cc

@@ -133,8 +133,10 @@ void KqueueEventPoll::poll(const struct timeval& tv)
       }
       p->processEvents(events);
     }
+  } else if(res == -1) {
+    int errNum = errno;
+    A2_LOG_INFO(fmt("kevent error: %s", util::safeStrerror(errNum).c_str()));
   }
-
 #ifdef ENABLE_ASYNC_DNS
   // It turns out that we have to call ares_process_fd before ares's
   // own timeout and ares may create new sockets or closes socket in

+ 3 - 0
src/PollEventPoll.cc

@@ -111,6 +111,9 @@ void PollEventPoll::poll(const struct timeval& tv)
         }
       }
     }
+  } else if(res == -1) {
+    int errNum = errno;
+    A2_LOG_INFO(fmt("poll error: %s", util::safeStrerror(errNum).c_str()));
   }
 #ifdef ENABLE_ASYNC_DNS
   // It turns out that we have to call ares_process_fd before ares's

+ 3 - 0
src/PortEventPoll.cc

@@ -131,6 +131,9 @@ void PortEventPoll::poll(const struct timeval& tv)
                          util::safeStrerror(errNum).c_str()));
       }
     }
+  } else if(res == -1) {
+    int errNum = errno;
+    A2_LOG_INFO(fmt("port_getn error: %s", util::safeStrerror(errNum).c_str()));
   }
 #ifdef ENABLE_ASYNC_DNS
   // It turns out that we have to call ares_process_fd before ares's

+ 3 - 0
src/SelectEventPoll.cc

@@ -213,6 +213,9 @@ void SelectEventPoll::poll(const struct timeval& tv)
       }
       (*i)->processEvents(events);
     }
+  } else if(res == -1) {
+    int errNum = errno;
+    A2_LOG_INFO(fmt("select error: %s", util::safeStrerror(errNum).c_str()));
   }
 #ifdef ENABLE_ASYNC_DNS