event/ServerSocket: add HAVE_UN check to AddAbstract()

Closes https://github.com/MusicPlayerDaemon/MPD/issues/510
This commit is contained in:
Max Kellermann 2019-03-20 13:06:09 +01:00
parent 4f408bd952
commit 8fc3c5c612
2 changed files with 7 additions and 0 deletions

1
NEWS
View File

@ -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

View File

@ -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