Fix build and C++ tests for FreeBSD (#10480)
This commit is contained in:
committed by
GitHub
parent
e8a962575a
commit
09d32f1f2b
@@ -22,10 +22,12 @@ namespace xgboost::collective {
|
||||
SockAddress MakeSockAddress(StringView host, in_port_t port) {
|
||||
struct addrinfo hints;
|
||||
std::memset(&hints, 0, sizeof(hints));
|
||||
hints.ai_protocol = SOCK_STREAM;
|
||||
hints.ai_socktype = SOCK_STREAM;
|
||||
struct addrinfo *res = nullptr;
|
||||
int sig = getaddrinfo(host.c_str(), nullptr, &hints, &res);
|
||||
if (sig != 0) {
|
||||
LOG(FATAL) << "Failed to get addr info for: " << host
|
||||
<< ", error: " << gai_strerror(sig);
|
||||
return {};
|
||||
}
|
||||
if (res->ai_family == static_cast<std::int32_t>(SockDomain::kV4)) {
|
||||
|
||||
Reference in New Issue
Block a user