[PATCH] no sin_len field in sockaddr_in on linux

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

We still need to set .sin_len on the platforms that have it though.

The (crappy) attached patch fixes the build failure under GNU/Linux. If
you are ok, I can apply it.
However, some tests freezes. Not sure it is related.

Sylvestre

sin_len.diff (1.97 KB)