From d40b2ad548e82a65094fa538b4bad231c3621860 Mon Sep 17 00:00:00 2001 From: Stephane Letz Date: Wed, 7 Aug 2013 21:52:26 +0200 Subject: [PATCH] Pawel : small fix for JackSession. --- common/JackEngine.cpp | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/common/JackEngine.cpp b/common/JackEngine.cpp index 95eb548c..04b8c780 100644 --- a/common/JackEngine.cpp +++ b/common/JackEngine.cpp @@ -1078,9 +1078,7 @@ void JackEngine::SessionNotify(int refnum, const char *target, jack_session_even JackSessionNotifyResult res(-1); res.Write(socket); jack_log("JackEngine::SessionNotify ... busy"); - if (result != NULL) { - *result = NULL; - } + if (result != NULL) *result = NULL; return; } @@ -1104,12 +1102,14 @@ void JackEngine::SessionNotify(int refnum, const char *target, jack_session_even } char path_buf[JACK_PORT_NAME_SIZE]; - snprintf(path_buf, sizeof(path_buf), "%s%s%c", path, client->GetClientControl()->fName, DIR_SEPARATOR); + if (path[strlen(path) - 1] == DIR_SEPARATOR) { + snprintf(path_buf, sizeof path_buf, "%s%s%c", path, client->GetClientControl()->fName, DIR_SEPARATOR); + } else { + snprintf(path_buf, sizeof path_buf, "%s%c%s%c", path, DIR_SEPARATOR, client->GetClientControl()->fName, DIR_SEPARATOR); + } int res = JackTools::MkDir(path_buf); - if (res) { - jack_error("JackEngine::SessionNotify: can not create session directory '%s'", path_buf); - } + if (res) jack_error("JackEngine::SessionNotify: can not create session directory '%s'", path_buf); int result = client->ClientNotify(i, client->GetClientControl()->fName, kSessionCallback, true, path_buf, (int)type, 0); @@ -1126,15 +1126,11 @@ void JackEngine::SessionNotify(int refnum, const char *target, jack_session_even } } - if (result != NULL) { - *result = fSessionResult; - } + if (result != NULL) *result = fSessionResult; if (fSessionPendingReplies == 0) { fSessionResult->Write(socket); - if (result == NULL) { - delete fSessionResult; - } + if (result == NULL) delete fSessionResult; fSessionResult = NULL; } else { fSessionTransaction = socket;