From a6846833ea254385d6432f78786db92480097925 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Mon, 20 Dec 2010 21:07:54 +0000 Subject: [PATCH] Patch from Stephen Wilson: POSIX does not define sockaddr_un.sun_len. Set only when required by the platform. llvm-svn: 122266 --- lldb/source/Core/ConnectionFileDescriptor.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lldb/source/Core/ConnectionFileDescriptor.cpp b/lldb/source/Core/ConnectionFileDescriptor.cpp index da199b99b5e4..30cab9f4c32c 100644 --- a/lldb/source/Core/ConnectionFileDescriptor.cpp +++ b/lldb/source/Core/ConnectionFileDescriptor.cpp @@ -432,7 +432,9 @@ 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) {