Commit 91b43b48 authored by Max Kellermann's avatar Max Kellermann Committed by Eric Wong

unlink the socket before bind()

If a unix domain socket already exists, bind() fails. Unlink the socket file. git-svn-id: https://svn.musicpd.org/mpd/trunk@7335 09075e82-0dd4-0310-85a5-a0d7c8717e4f
parent 3919a875
......@@ -178,6 +178,8 @@ static void parseListenConfigParam(unsigned int port, ConfigParam * param)
if (path_length >= sizeof(sun.sun_path))
FATAL("unix socket path is too long\n");
unlink(param->value);
sun.sun_family = AF_UNIX;
memcpy(sun.sun_path, param->value, path_length + 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment