Skip to content

Commit 24096a2

Browse files
Update socket.cpp
1 parent de70d97 commit 24096a2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clickhouse/base/socket.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ NetworkAddress::NetworkAddress(const std::string& host, const std::string& port)
182182
hints.ai_family = PF_UNSPEC;
183183
hints.ai_socktype = SOCK_STREAM;
184184

185+
#if defined(_unix_)
185186
if (!Singleton<LocalNames>()->IsLocalName(host)) {
186187
// https://linux.die.net/man/3/getaddrinfo
187188
// If hints.ai_flags includes the AI_ADDRCONFIG flag,
@@ -193,6 +194,7 @@ NetworkAddress::NetworkAddress(const std::string& host, const std::string& port)
193194
// as valid as a configured address.
194195
hints.ai_flags |= AI_ADDRCONFIG;
195196
}
197+
#endif
196198

197199
const int error = getaddrinfo(host.c_str(), port.c_str(), &hints, &info_);
198200

0 commit comments

Comments
 (0)