From 91b43b481dfab06de99a715c2e69f4c14c780abc Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 12 Apr 2008 04:20:56 +0000 Subject: 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 --- src/listen.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/listen.c b/src/listen.c index cf4628c07..2b9b38619 100644 --- a/src/listen.c +++ b/src/listen.c @@ -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); -- cgit v1.2.3