summaryrefslogtreecommitdiff
path: root/src/network.c
diff options
context:
space:
mode:
authorGlenn Strauss <gstrauss@gluelogic.com>2016-07-29 12:48:00 -0400
committerGlenn Strauss <gstrauss@gluelogic.com>2016-07-29 12:48:00 -0400
commitad6d41896efec57577850206737acb079cf026d0 (patch)
treeca96fe6a5bb431ec9c4a22c6d8c6c31a51e05c98 /src/network.c
parentc8e647ad3199de63d05489a89ef4e27aadc1e280 (diff)
downloadlighttpd1.4-ad6d41896efec57577850206737acb079cf026d0.tar.gz
lighttpd1.4-ad6d41896efec57577850206737acb079cf026d0.zip
[core] check if EAI_ADDRFAMILY is defined
(EAI_ADDRFAMILY is not available on FreeBSD)
Diffstat (limited to 'src/network.c')
-rw-r--r--src/network.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/network.c b/src/network.c
index 4693b91b..dfa80a43 100644
--- a/src/network.c
+++ b/src/network.c
@@ -282,7 +282,11 @@ static int network_server_init(server *srv, buffer *host_token, specific_config
if (0 != (r = getaddrinfo(host, NULL, &hints, &res))) {
hints.ai_family = AF_INET;
- if (EAI_ADDRFAMILY == r && 0 == getaddrinfo(host, NULL, &hints, &res)) {
+ if (
+ #ifdef EAI_ADDRFAMILY
+ EAI_ADDRFAMILY == r &&
+ #endif
+ 0 == getaddrinfo(host, NULL, &hints, &res)) {
memcpy(&srv_socket->addr.ipv4, res->ai_addr, res->ai_addrlen);
srv_socket->addr.ipv4.sin_family = AF_INET;
srv_socket->addr.ipv4.sin_port = htons(port);