aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-02-13 21:04:50 +0100
committerMax Kellermann <max@duempel.org>2012-02-13 21:05:05 +0100
commit652cfb7caf8c0c7ac35043bb56746ef96dfb7c6d (patch)
tree15a9421dbffe529c5aeee597391e8640f59a00f5 /src
parent5540fbaec250bbb8601d9eaec7f7c20922a67979 (diff)
downloadmpd-652cfb7caf8c0c7ac35043bb56746ef96dfb7c6d.tar.gz
mpd-652cfb7caf8c0c7ac35043bb56746ef96dfb7c6d.tar.xz
mpd-652cfb7caf8c0c7ac35043bb56746ef96dfb7c6d.zip
zeroconf: skip initialisation if there is no port
Diffstat (limited to '')
-rw-r--r--src/zeroconf.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/zeroconf.c b/src/zeroconf.c
index 907eb8bfc..4a399e4a2 100644
--- a/src/zeroconf.c
+++ b/src/zeroconf.c
@@ -21,6 +21,7 @@
#include "zeroconf.h"
#include "zeroconf-internal.h"
#include "conf.h"
+#include "listen.h"
#include <glib.h>
@@ -42,6 +43,12 @@ void initZeroconf(void)
if (!zeroconfEnabled)
return;
+ if (listen_port <= 0) {
+ g_warning("No global port, disabling zeroconf");
+ zeroconfEnabled = false;
+ return;
+ }
+
serviceName = config_get_string(CONF_ZEROCONF_NAME, SERVICE_NAME);
#ifdef HAVE_AVAHI