From b234f4307f454c044e0c35cd0a838457c8e02040 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 11 Aug 2017 09:03:25 +0200 Subject: [PATCH] net/SocketDescriptor: AcceptNonBlock() enables non-blocking even if SOCK_NONBLOCK is unavailable --- src/net/SocketDescriptor.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/net/SocketDescriptor.cxx b/src/net/SocketDescriptor.cxx index bc914ae93..146149af0 100644 --- a/src/net/SocketDescriptor.cxx +++ b/src/net/SocketDescriptor.cxx @@ -77,6 +77,8 @@ SocketDescriptor::AcceptNonBlock(StaticSocketAddress &address) const SOCK_CLOEXEC|SOCK_NONBLOCK); #else int connection_fd = ::accept(Get(), address, &address.size); + if (connection_fd >= 0) + SocketDescriptor(connection_fd).SetNonBlocking(); #endif return SocketDescriptor(connection_fd); }