summaryrefslogtreecommitdiff
path: root/configure.cmake
diff options
context:
space:
mode:
authorAlexander Nozdrin <alik@sun.com>2010-05-21 17:17:01 +0400
committerAlexander Nozdrin <alik@sun.com>2010-05-21 17:17:01 +0400
commit9003fb7cad18d091ee9f94c72f7304c2f6c4f6e5 (patch)
treecee7c59ceb75b7c60315f06eaa747756fbebeb97 /configure.cmake
parent44486663e2dffe756918b8efc226af1716872f8c (diff)
downloadmariadb-git-9003fb7cad18d091ee9f94c72f7304c2f6c4f6e5.tar.gz
Fix for Bug#52923 (Inadequate documentation of "Can't get hostname for your address" error).
The thing is that on some platforms (e.g. Mac OS X) sockaddr_in / sockaddr_in6 contain a non-standard field (sin_len / sin6_len), that must be set. The problem was that only standard fields were set, thus getnameinfo() returned EAI_SYSTEM instead of EAI_NONAME. The fix is to introduce configure-time checks (for GNU auto-tools and CMake) for those additional fields and to set them if they are available.
Diffstat (limited to 'configure.cmake')
-rw-r--r--configure.cmake15
1 files changed, 15 insertions, 0 deletions
diff --git a/configure.cmake b/configure.cmake
index 94d2cfd5804..df71a96ee47 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -1000,6 +1000,21 @@ IF(NOT HAVE_SOCKADDR_STORAGE_SS_FAMILY)
SET(ss_family __ss_family)
ENDIF()
ENDIF()
+
+#
+# Check if struct sockaddr_in::sin_len is available.
+#
+
+CHECK_STRUCT_HAS_MEMBER("struct sockaddr_in" sin_len
+ "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_SOCKADDR_IN_SIN_LEN)
+
+#
+# Check if struct sockaddr_in6::sin6_len is available.
+#
+
+CHECK_STRUCT_HAS_MEMBER("struct sockaddr_in6" sin6_len
+ "${CMAKE_EXTRA_INCLUDE_FILES}" HAVE_SOCKADDR_IN6_SIN6_LEN)
+
SET(CMAKE_EXTRA_INCLUDE_FILES)
CHECK_STRUCT_HAS_MEMBER("struct dirent" d_ino "dirent.h" STRUCT_DIRENT_HAS_D_INO)