[lldb-dev] [PATCH] no sin_len field in sockaddr_in on linux

Xavier de Gaye xdegaye at gmail.com
Sun Dec 8 13:24:45 PST 2013


Build fails on linux after Revision 196547:
Modified local spawning in debugserver processes

This patch seems to fix it:

diff --git a/tools/lldb/source/Core/ConnectionFileDescriptor.cpp
b/tools/lldb/source/Core/ConnectionFileDescriptor.cpp
--- a/tools/lldb/source/Core/ConnectionFileDescriptor.cpp
+++ b/tools/lldb/source/Core/ConnectionFileDescriptor.cpp
@@ -1380,8 +1380,7 @@
         {
             struct sockaddr_in accept_addr;
             ::memset (&accept_addr, 0, sizeof accept_addr);
-            accept_addr.sin_len = sizeof accept_addr;
-            socklen_t accept_addr_len = sizeof accept_addr;
+            socklen_t accept_addr_len = SocketAddress(accept_addr).GetLength();

             int fd = ::accept (listen_fd, (struct sockaddr
*)&accept_addr, &accept_addr_len);

@@ -1399,7 +1398,7 @@
             }
             else
             {
-                if (accept_addr_len == listen_addr.sockaddr_in().sin_len &&
+                if (accept_addr_len == listen_addr.GetLength() &&
                     accept_addr.sin_addr.s_addr ==
listen_addr.sockaddr_in().sin_addr.s_addr)
                 {
                     accept_connection = true;

Xavier



More information about the lldb-dev mailing list