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
This commit is contained in:
parent
3919a87525
commit
91b43b481d
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user