aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-12-02 10:23:36 +0100
committerMax Kellermann <max@duempel.org>2008-12-02 10:23:36 +0100
commit6902ff20846dcb98596d9d04c19e752e830645c5 (patch)
tree4dbb47a8ef5fd3a0344280137bb5cd10142cd5e0 /src
parentac0af919129ea36e14d3b7c3f14d86a73c2a7fa6 (diff)
downloadmpd-6902ff20846dcb98596d9d04c19e752e830645c5.tar.gz
mpd-6902ff20846dcb98596d9d04c19e752e830645c5.tar.xz
mpd-6902ff20846dcb98596d9d04c19e752e830645c5.zip
listen: check if AI_ADDRCONFIG is defined
AI_ADDRCONFIG is not available on all operating systems. Check if it is defined in the current build environment.
Diffstat (limited to 'src')
-rw-r--r--src/listen.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/listen.c b/src/listen.c
index 0e2dd6611..0e3467364 100644
--- a/src/listen.c
+++ b/src/listen.c
@@ -190,7 +190,10 @@ static void parseListenConfigParam(unsigned int port, ConfigParam * param)
DEBUG("binding to address for %s\n", param->value);
memset(&hints, 0, sizeof(hints));
- hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
+ hints.ai_flags = AI_PASSIVE;
+#ifdef AI_ADDRCONFIG
+ hints.ai_flags |= AI_ADDRCONFIG;
+#endif
hints.ai_family = PF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;