diff --git a/source/common/api/posix/os_sys_calls_impl.cc b/source/common/api/posix/os_sys_calls_impl.cc index 7df7e6384e90..3fab0afc1b55 100644 --- a/source/common/api/posix/os_sys_calls_impl.cc +++ b/source/common/api/posix/os_sys_calls_impl.cc @@ -325,17 +325,12 @@ SysCallSocketResult OsSysCallsImpl::accept(os_fd_t sockfd, sockaddr* addr, sockl #if defined(__linux__) rc = ::accept4(sockfd, addr, addrlen, SOCK_NONBLOCK); - // If failed with EINVAL try without flags - if (rc >= 0 || errno != EINVAL) { - return {rc, rc != -1 ? 0 : errno}; - } -#endif - +#else rc = ::accept(sockfd, addr, addrlen); if (rc >= 0) { setsocketblocking(rc, false); } - +#endif return {rc, rc != -1 ? 0 : errno}; }