aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-19 23:49:34 +0100
committerMax Kellermann <max@duempel.org>2014-02-19 23:49:34 +0100
commite609c8833498e43b024b8742ec5b7a99e2be0760 (patch)
tree85ff62ea830608da89352afca4ad980e26cebde5 /src
parente92a41fa3abba0aa7386bbfe14fa5c2887c4eb27 (diff)
downloadmpd-e609c8833498e43b024b8742ec5b7a99e2be0760.tar.gz
mpd-e609c8833498e43b024b8742ec5b7a99e2be0760.tar.xz
mpd-e609c8833498e43b024b8742ec5b7a99e2be0760.zip
Listen: reduce overhead for builds without systemd
Diffstat (limited to 'src')
-rw-r--r--src/Listen.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Listen.cxx b/src/Listen.cxx
index 85a7f1c41..b967ee3b8 100644
--- a/src/Listen.cxx
+++ b/src/Listen.cxx
@@ -77,10 +77,11 @@ listen_add_config_param(unsigned int port,
}
}
+#ifdef ENABLE_SYSTEMD_DAEMON
+
static bool
listen_systemd_activation(Error &error_r)
{
-#ifdef ENABLE_SYSTEMD_DAEMON
int n = sd_listen_fds(true);
if (n <= 0) {
if (n < 0)
@@ -95,12 +96,10 @@ listen_systemd_activation(Error &error_r)
return false;
return true;
-#else
- (void)error_r;
- return false;
-#endif
}
+#endif
+
bool
listen_global_init(EventLoop &loop, Partition &partition, Error &error)
{
@@ -111,11 +110,13 @@ listen_global_init(EventLoop &loop, Partition &partition, Error &error)
listen_socket = new ClientListener(loop, partition);
+#ifdef ENABLE_SYSTEMD_DAEMON
if (listen_systemd_activation(error))
return true;
if (error.IsDefined())
return false;
+#endif
if (param != nullptr) {
/* "bind_to_address" is configured, create listeners