diff --git a/xdl/ps-plus/ps-plus/common/net_utils.cc b/xdl/ps-plus/ps-plus/common/net_utils.cc index 8e1cd952..4f183110 100644 --- a/xdl/ps-plus/ps-plus/common/net_utils.cc +++ b/xdl/ps-plus/ps-plus/common/net_utils.cc @@ -45,6 +45,7 @@ bool NetUtils::GetIP(std::vector& ips) { } struct hostent* hent; hent = gethostbyname(hostName.c_str()); + PS_CHECK(hent) << " error! Can not get host [" << hostName << "]\'s host entry.(Please check /etc/hosts)!\n"; for (uint32_t i = 0; hent->h_addr_list[i]; i++) { std::string ip = inet_ntoa(*(struct in_addr*)(hent->h_addr_list[i])); ips.push_back(ip);