[Lldb-commits] [PATCH] linux: Set sockaddr_un.sun_len according to platform.

Stephen Wilson wilsons at start.ca
Mon Dec 20 12:28:46 PST 2010


POSIX does not define sockaddr_un.sun_len.  Set only when required by
the platform.


diff --git a/source/Core/ConnectionFileDescriptor.cpp b/source/Core/ConnectionFileDescriptor.cpp
index da199b9..56b8312 100644
--- a/source/Core/ConnectionFileDescriptor.cpp
+++ b/source/Core/ConnectionFileDescriptor.cpp
@@ -432,7 +432,10 @@ ConnectionFileDescriptor::NamedSocketAccept (const char *socket_name, Error *err
     saddr_un.sun_family = AF_UNIX;
     ::strncpy(saddr_un.sun_path, socket_name, sizeof(saddr_un.sun_path) - 1);
     saddr_un.sun_path[sizeof(saddr_un.sun_path) - 1] = '\0';
+
+#if defined(__APPLE__) || defined(__FreeBSD__)
     saddr_un.sun_len = SUN_LEN (&saddr_un);
+#endif
 
     if (::bind (listen_socket, (struct sockaddr *)&saddr_un, SUN_LEN (&saddr_un)) == 0) 
     {



More information about the lldb-commits mailing list