mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-12 17:00:25 +08:00
Always use SOCK_CLOEXEC in tcp client
This commit is contained in:
parent
1389f86675
commit
2b0481deed
@ -75,11 +75,7 @@ public:
|
|||||||
int last_errno = 0;
|
int last_errno = 0;
|
||||||
for (auto *rp = addrinfo_result; rp != nullptr; rp = rp->ai_next)
|
for (auto *rp = addrinfo_result; rp != nullptr; rp = rp->ai_next)
|
||||||
{
|
{
|
||||||
#ifdef SPDLOG_PREVENT_CHILD_FD
|
|
||||||
int const flags = SOCK_CLOEXEC;
|
int const flags = SOCK_CLOEXEC;
|
||||||
#else
|
|
||||||
int const flags = 0;
|
|
||||||
#endif
|
|
||||||
socket_ = ::socket(rp->ai_family, rp->ai_socktype | flags, rp->ai_protocol);
|
socket_ = ::socket(rp->ai_family, rp->ai_socktype | flags, rp->ai_protocol);
|
||||||
if (socket_ == -1)
|
if (socket_ == -1)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user