Add support for non-glibc systems

MaxScale can now be built on systems that use an alternative libc
implementation e.g. musl.
This commit is contained in:
Markus Mäkelä
2017-07-28 14:14:47 +03:00
parent 782b8db2aa
commit 854c4a1ed3
17 changed files with 104 additions and 77 deletions

View File

@ -37,7 +37,6 @@
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/un.h>
#include <netinet/tcp.h>
#include <openssl/sha.h>
@ -989,7 +988,6 @@ static void set_port(struct sockaddr_storage *addr, uint16_t port)
int open_network_socket(enum mxs_socket_type type, struct sockaddr_storage *addr, const char *host, uint16_t port)
{
ss_dassert(type == MXS_SOCKET_NETWORK || type == MXS_SOCKET_LISTENER);
#ifdef __USE_POSIX
struct addrinfo *ai = NULL, hint = {};
int so, rc;
hint.ai_socktype = SOCK_STREAM;
@ -1032,10 +1030,6 @@ int open_network_socket(enum mxs_socket_type type, struct sockaddr_storage *addr
freeaddrinfo(ai);
}
#else
#error Only the POSIX networking interface is supported
#endif
return so;
}