From 025b31a474d1f935f4871044c00331db1bd23ab2 Mon Sep 17 00:00:00 2001 From: Jake Smith Date: Fri, 18 Oct 2024 13:12:31 +0100 Subject: [PATCH] HPCC-32827 Allow Dali to start in BM without a configuration file If daserver was started in BM without a deployed configuration it would fail to start because NamedMutex created a mutex file path based in root (/), which then failed to create. Signed-off-by: Jake Smith --- system/jlib/jmutex.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/system/jlib/jmutex.cpp b/system/jlib/jmutex.cpp index f2b5589ac1c..49d4ed1521a 100644 --- a/system/jlib/jmutex.cpp +++ b/system/jlib/jmutex.cpp @@ -205,14 +205,15 @@ NamedMutex::NamedMutex(const char *name) CriticalBlock b(lockPrefixCS); if (0 == lockPrefix.length()) { - if (!getConfigurationDirectory(NULL, "lock", NULL, NULL, lockPrefix)) + if (getConfigurationDirectory(NULL, "lock", NULL, NULL, lockPrefix)) + addPathSepChar(lockPrefix); + else WARNLOG("Failed to get lock directory from environment"); + lockPrefix.append("JLIBMUTEX_"); } - addPathSepChar(lockPrefix); - lockPrefix.append("JLIBMUTEX_"); } StringBuffer tmp(lockPrefix); - tmp.append("JLIBMUTEX_").append(name); + tmp.append(name); mutexfname = tmp.detach(); }