diff options
author | Alexander Nozdrin <alik@sun.com> | 2010-05-21 17:17:01 +0400 |
---|---|---|
committer | Alexander Nozdrin <alik@sun.com> | 2010-05-21 17:17:01 +0400 |
commit | 75e552d50910e88debeca2fa18cc6d9a18da1843 (patch) | |
tree | cee7c59ceb75b7c60315f06eaa747756fbebeb97 /configure.cmake | |
parent | 534b3a520b0796c85bde36b2790d0e2c62184c1f (diff) | |
download | mariadb-git-75e552d50910e88debeca2fa18cc6d9a18da1843.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.cmake | 15 |
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) |