summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/ConnectionFileDescriptor.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-07-22 19:12:42 +0000
committerPeter Collingbourne <peter@pcc.me.uk>2011-07-22 19:12:42 +0000
commit9a8d848caffc4e0ad808fca5e498b7613bbdc3c4 (patch)
treee52fe4a7d312e83ca6eaf5d0e566a33fefa35288 /lldb/source/Core/ConnectionFileDescriptor.cpp
parent77242dd5378897f6d5c8f631d0ad5d385bc3e5f7 (diff)
downloadbcm5719-llvm-9a8d848caffc4e0ad808fca5e498b7613bbdc3c4.tar.gz
bcm5719-llvm-9a8d848caffc4e0ad808fca5e498b7613bbdc3c4.zip
Add support for platforms without sa_len to SocketAddress, and modify
some code to use it llvm-svn: 135790
Diffstat (limited to 'lldb/source/Core/ConnectionFileDescriptor.cpp')
-rw-r--r--lldb/source/Core/ConnectionFileDescriptor.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/lldb/source/Core/ConnectionFileDescriptor.cpp b/lldb/source/Core/ConnectionFileDescriptor.cpp
index c560718f0dc..5c0e97d71e2 100644
--- a/lldb/source/Core/ConnectionFileDescriptor.cpp
+++ b/lldb/source/Core/ConnectionFileDescriptor.cpp
@@ -842,14 +842,10 @@ ConnectionFileDescriptor::ConnectUDP (const char *host_and_port, Error *error_pt
else
{
// Socket was created, now lets bind to the requested port
- struct sockaddr_in sin;
- ::memset (&sin, 0, sizeof(sin));
- sin.sin_len = sizeof(sin);
- sin.sin_family = AF_INET;
- sin.sin_port = 0;
- sin.sin_addr.s_addr = htonl (INADDR_ANY);
-
- if (::bind (m_fd_recv, (struct sockaddr *)&sin, sizeof(sin)) == -1)
+ SocketAddress addr;
+ addr.SetToLocalhost (AF_INET, 0);
+
+ if (::bind (m_fd_recv, addr, addr.GetLength()) == -1)
{
// Bind failed...
if (error_ptr)
OpenPOWER on IntegriCloud