Commit 225b90ee authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

Use switch-case instead of if

parent 3931a0b0
......@@ -370,17 +370,18 @@ void perform_accept_pending_connection(ListenHandler *listener_handler,
auto fd = accept(server_fd, &sockaddr.sa, &addrlen);
if(fd == -1) {
if(errno == EINTR ||
errno == ENETDOWN ||
errno == EPROTO ||
errno == ENOPROTOOPT ||
errno == EHOSTDOWN ||
switch(errno) {
case EINTR:
case ENETDOWN:
case EPROTO:
case ENOPROTOOPT:
case EHOSTDOWN:
#ifdef ENONET
errno == ENONET ||
case ENONET:
#endif // ENONET
errno == EHOSTUNREACH ||
errno == EOPNOTSUPP ||
errno == ENETUNREACH) {
case EHOSTUNREACH:
case EOPNOTSUPP:
case ENETUNREACH:
continue;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment