event/ServerSocket: runtime error if abstract sockets are unavailable

This commit is contained in:
Max Kellermann
2019-03-20 13:09:16 +01:00
parent 8fc3c5c612
commit a854595886
3 changed files with 5 additions and 9 deletions

View File

@@ -397,12 +397,14 @@ ServerSocket::AddPath(AllocatedPath &&path)
}
#ifdef __linux__
void
ServerSocket::AddAbstract(const char *name)
{
#if !defined(HAVE_UN)
#if !defined(__linux__)
(void)name;
throw std::runtime_error("Abstract sockets are only available on Linux");
#elif !defined(HAVE_UN)
(void)name;
throw std::runtime_error("Local socket support is disabled");
@@ -416,5 +418,3 @@ ServerSocket::AddAbstract(const char *name)
AddAddress(std::move(address));
#endif
}
#endif