net/SocketDescriptor: fix SOCK_NONBLOCK flag in CreateSocketPairNonBlock()
This commit is contained in:
@@ -192,14 +192,14 @@ SocketDescriptor::CreateSocketPairNonBlock(int domain, int type, int protocol,
|
|||||||
SocketDescriptor &a,
|
SocketDescriptor &a,
|
||||||
SocketDescriptor &b) noexcept
|
SocketDescriptor &b) noexcept
|
||||||
{
|
{
|
||||||
#ifdef SOCK_CLOEXEC
|
#ifdef SOCK_NONBLOCK
|
||||||
/* implemented since Linux 2.6.27 */
|
type |= SOCK_NONBLOCK;
|
||||||
type |= SOCK_CLOEXEC;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!CreateSocketPair(domain, type, protocol, a, b))
|
if (!CreateSocketPair(domain, type, protocol, a, b))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#ifndef __linux__
|
#ifndef SOCK_NONBLOCK
|
||||||
a.SetNonBlocking();
|
a.SetNonBlocking();
|
||||||
b.SetNonBlocking();
|
b.SetNonBlocking();
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user