From 8fc3c5c6123f6d36219e31ad5ef011a8179ed2cd Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 20 Mar 2019 13:06:09 +0100 Subject: [PATCH] event/ServerSocket: add HAVE_UN check to AddAbstract() Closes https://github.com/MusicPlayerDaemon/MPD/issues/510 --- NEWS | 1 + src/event/ServerSocket.cxx | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/NEWS b/NEWS index d4b5df01b..31990d63a 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,6 @@ ver 0.21.7 (not yet released) * require Meson 0.49.0 for native libgcrypt-config support +* fix build failure with -Dlocal_socket=false ver 0.21.6 (2019/03/17) * protocol diff --git a/src/event/ServerSocket.cxx b/src/event/ServerSocket.cxx index 38f84b873..4ff5481e7 100644 --- a/src/event/ServerSocket.cxx +++ b/src/event/ServerSocket.cxx @@ -402,6 +402,11 @@ ServerSocket::AddPath(AllocatedPath &&path) void ServerSocket::AddAbstract(const char *name) { +#if !defined(HAVE_UN) + (void)name; + + throw std::runtime_error("Local socket support is disabled"); +#else assert(name != nullptr); assert(*name == '@'); @@ -409,6 +414,7 @@ ServerSocket::AddAbstract(const char *name) address.SetLocal(name); AddAddress(std::move(address)); +#endif } #endif