Fix busy loop

This commit is contained in:
Tatsuhiro Tsujikawa 2015-03-11 00:11:51 +09:00
parent 0e3ae63965
commit a0524ef05d
1 changed files with 1 additions and 4 deletions

View File

@ -1397,10 +1397,7 @@ public:
auto fd = accept(fd_, nullptr, nullptr); auto fd = accept(fd_, nullptr, nullptr);
#endif // !HAVE_ACCEPT4 #endif // !HAVE_ACCEPT4
if (fd == -1) { if (fd == -1) {
if (errno == EAGAIN || errno == EWOULDBLOCK) { break;
break;
}
continue;
} }
#ifndef HAVE_ACCEPT4 #ifndef HAVE_ACCEPT4
util::make_socket_nonblocking(fd); util::make_socket_nonblocking(fd);