aboutsummaryrefslogtreecommitdiffstats
path: root/src/Listen.cxx
diff options
context:
space:
mode:
authorMaarten de Vries <maarten@de-vri.es>2013-08-25 15:51:41 +0200
committerMax Kellermann <max@duempel.org>2013-09-12 08:55:45 +0200
commit08e6d222a2dea2509baea0a19b754743374756d3 (patch)
tree428ca5c503a3bc4088052d3ed2233b4315869081 /src/Listen.cxx
parentcf98b0e261ab40e199ff505a27510a56762c8091 (diff)
downloadmpd-08e6d222a2dea2509baea0a19b754743374756d3.tar.gz
mpd-08e6d222a2dea2509baea0a19b754743374756d3.tar.xz
mpd-08e6d222a2dea2509baea0a19b754743374756d3.zip
Listen: Allow tilde paths for socket.
Diffstat (limited to 'src/Listen.cxx')
-rw-r--r--src/Listen.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Listen.cxx b/src/Listen.cxx
index 2813c6bfb..0dcd6fddf 100644
--- a/src/Listen.cxx
+++ b/src/Listen.cxx
@@ -27,6 +27,7 @@
#include "ConfigOption.hxx"
#include "event/ServerSocket.hxx"
#include "util/Error.hxx"
+#include "fs/Path.hxx"
#include <string.h>
#include <assert.h>
@@ -64,8 +65,9 @@ listen_add_config_param(unsigned int port,
if (0 == strcmp(param->value, "any")) {
return listen_socket->AddPort(port, error_r);
- } else if (param->value[0] == '/') {
- return listen_socket->AddPath(param->value, error_r);
+ } else if (param->value[0] == '/' || param->value[0] == '~') {
+ Path path = config_parse_path(param, error_r);
+ return !path.IsNull() && listen_socket->AddPath(path.c_str(), error_r);
} else {
return listen_socket->AddHost(param->value, port, error_r);
}