sock: set AI_ADDRCONFIG only if defined

AI_ADDRCONFIG is undefined on some systems.
This commit is contained in:
Dmitry Podgorny
2015-10-10 23:09:48 +03:00
parent e6bbfa7a62
commit 63946ff7ef

View File

@@ -86,7 +86,9 @@ sock_t sock_connect(const char * const host, const unsigned int port)
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_family = AF_UNSPEC;
#ifdef AI_ADDRCONFIG
hints.ai_flags = AI_ADDRCONFIG;
#endif /* AI_ADDRCONFIG */
hints.ai_protocol = IPPROTO_TCP;
hints.ai_socktype = SOCK_STREAM;