Fix SOCK_CLOEXEC removal

(cherry picked from commit ad6ef2fb7a)
This commit is contained in:
Martin 2020-01-17 17:16:04 +01:00
parent f8a7e36bba
commit 6f0776ed21
5 changed files with 5 additions and 5 deletions

View File

@ -1088,7 +1088,7 @@ IPipe* CServer::ConnectStream(const SLookupBlockingResult& lookup_result, unsign
#if !defined(_WIN32) && defined(SOCK_CLOEXEC)
if (errno == EINVAL)
{
type |= ~SOCK_CLOEXEC;
type &= ~SOCK_CLOEXEC;
s = socket(lookup_result.is_ipv6 ? AF_INET6 : AF_INET, type, 0);
}
#endif

View File

@ -299,7 +299,7 @@ bool CServiceAcceptor::init_socket_v4(unsigned short port, IServer::BindTarget b
#if !defined(_WIN32) && defined(SOCK_CLOEXEC)
if (errno == EINVAL)
{
type |= ~SOCK_CLOEXEC;
type &= ~SOCK_CLOEXEC;
s = socket(AF_INET, type, 0);
}
#endif

View File

@ -123,7 +123,7 @@ std::string Connector::getResponse(const std::string &cmd, const std::string &ar
#if !defined(_WIN32) && defined(SOCK_CLOEXEC)
if (errno == EINVAL)
{
type |= ~SOCK_CLOEXEC;
type &= ~SOCK_CLOEXEC;
p = socket(lookup_result.is_ipv6 ? AF_INET6 : AF_INET, type, 0);
}
#endif

View File

@ -364,7 +364,7 @@ bool CTCPFileServ::startIpv4(_u16 tcpport)
#if !defined(_WIN32) && defined(SOCK_CLOEXEC)
if (errno == EINVAL)
{
type |= ~SOCK_CLOEXEC;
type &= ~SOCK_CLOEXEC;
mSocket = socket(AF_INET, type, 0);
}
#endif

View File

@ -266,7 +266,7 @@ bool CUDPThread::init_v4(_u16 udpport)
#if !defined(_WIN32) && defined(SOCK_CLOEXEC)
if (errno == EINVAL)
{
type |= ~SOCK_CLOEXEC;
type &= ~SOCK_CLOEXEC;
udpsock = socket(AF_INET, type, 0);
}
#endif