From 3e63ef6ebb340013459899e6dcb3be045384fa95 Mon Sep 17 00:00:00 2001 From: Stephane Letz Date: Tue, 15 Jan 2013 08:07:14 +0100 Subject: [PATCH] Correct JackServerSocket::Bind. --- posix/JackSocket.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/posix/JackSocket.cpp b/posix/JackSocket.cpp index 9afb11ed..ae0f5a0f 100644 --- a/posix/JackSocket.cpp +++ b/posix/JackSocket.cpp @@ -253,8 +253,10 @@ int JackServerSocket::Bind(const char* dir, const char* name, int which) // A re } addr.sun_family = AF_UNIX; - BuildName(name, addr.sun_path, dir, which, sizeof(addr.sun_path)); - + // Socket name has to be kept in fName to be "unlinked". + BuildName(name, fName, dir, which, sizeof(addr.sun_path)); + strncpy(addr.sun_path, fName, sizeof(addr.sun_path) - 1); + jack_log("JackServerSocket::Bind : addr.sun_path %s", addr.sun_path); unlink(fName); // Security...