mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Return LockResult::ErrorWrite in LockDirectory
This allows the caller to remove a call to DirIsWritable(), which did a similar check. Users should not notice any different behavior.
This commit is contained in:
parent
fa0afe7408
commit
fad3a9793b
4 changed files with 17 additions and 7 deletions
|
|
@ -1028,10 +1028,9 @@ static bool LockDataDirectory(bool probeOnly)
|
|||
{
|
||||
// Make sure only a single Bitcoin process is using the data directory.
|
||||
const fs::path& datadir = gArgs.GetDataDirNet();
|
||||
if (!DirIsWritable(datadir)) {
|
||||
return InitError(strprintf(_("Cannot write to data directory '%s'; check permissions."), fs::PathToString(datadir)));
|
||||
}
|
||||
switch (util::LockDirectory(datadir, ".lock", probeOnly)) {
|
||||
case util::LockResult::ErrorWrite:
|
||||
return InitError(strprintf(_("Cannot write to data directory '%s'; check permissions."), fs::PathToString(datadir)));
|
||||
case util::LockResult::ErrorLock:
|
||||
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. %s is probably already running."), fs::PathToString(datadir), PACKAGE_NAME));
|
||||
case util::LockResult::Success: return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue