summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 04517b3)
raw | patch | inline | side by side (parent: 04517b3)
author | Sebastian Harl <sh@tokkee.org> | |
Wed, 11 Dec 2013 10:26:24 +0000 (11:26 +0100) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Wed, 11 Dec 2013 10:26:24 +0000 (11:26 +0100) |
src/frontend/sock.c | patch | blob | history |
diff --git a/src/frontend/sock.c b/src/frontend/sock.c
index 4cf1d79e295a832e44d08a272156f4800fe6eb6b..65884ea945bf61fe935b48fe60ab819b453b1eb8 100644 (file)
--- a/src/frontend/sock.c
+++ b/src/frontend/sock.c
strncpy(sa.sun_path, listener->address + strlen("unix:"),
sizeof(sa.sun_path));
+ if (unlink(listener->address + strlen("unix:")) && (errno != ENOENT)) {
+ char errbuf[1024];
+ sdb_log(SDB_LOG_WARNING, "frontend: Failed to remove stale UNIX "
+ "socket %s: %s", listener->address + strlen("unix:"),
+ sdb_strerror(errno, errbuf, sizeof(errbuf)));
+ }
+
status = bind(listener->sock_fd, (struct sockaddr *)&sa, sizeof(sa));
if (status) {
char buf[1024];