summaryrefslogtreecommitdiffstats
path: root/source/Host/common/SocketAddress.cpp
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2015-02-06 21:38:51 +0000
committeremaste <emaste@FreeBSD.org>2015-02-06 21:38:51 +0000
commit0c2019f4ca6b2dc6d710f6bb16a0e3ed10271531 (patch)
tree09bc83f73246ee3c7a779605cd0122093d2a8a19 /source/Host/common/SocketAddress.cpp
parent01ee1789d6aa7294e5966a97f8d29387f6f81699 (diff)
downloadFreeBSD-src-0c2019f4ca6b2dc6d710f6bb16a0e3ed10271531.zip
FreeBSD-src-0c2019f4ca6b2dc6d710f6bb16a0e3ed10271531.tar.gz
Import LLDB as of upstream SVN r225923 (git 2b588ecd)
This corresponds with the branchpoint for the 3.6 release. A number of files not required for the FreeBSD build have been removed. Sponsored by: DARPA, AFRL
Diffstat (limited to 'source/Host/common/SocketAddress.cpp')
-rw-r--r--source/Host/common/SocketAddress.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/source/Host/common/SocketAddress.cpp b/source/Host/common/SocketAddress.cpp
index a952a83..6231631 100644
--- a/source/Host/common/SocketAddress.cpp
+++ b/source/Host/common/SocketAddress.cpp
@@ -214,6 +214,8 @@ SocketAddress::getaddrinfo (const char *host,
int ai_protocol,
int ai_flags)
{
+ Clear ();
+
struct addrinfo hints;
memset(&hints, 0, sizeof(hints));
hints.ai_family = ai_family;
@@ -221,15 +223,17 @@ SocketAddress::getaddrinfo (const char *host,
hints.ai_protocol = ai_protocol;
hints.ai_flags = ai_flags;
+ bool result = false;
struct addrinfo *service_info_list = NULL;
int err = ::getaddrinfo (host, service, &hints, &service_info_list);
if (err == 0 && service_info_list)
+ {
*this = service_info_list;
- else
- Clear();
+ result = IsValid ();
+ }
:: freeaddrinfo (service_info_list);
- return IsValid();
+ return result;
}
OpenPOWER on IntegriCloud