mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-14 06:32:33 +01:00
Provide relevant error message if datadir is not writable.
This commit is contained in:
@@ -1165,6 +1165,9 @@ static bool LockDataDirectory(bool probeOnly)
|
||||
{
|
||||
// Make sure only a single Bitcoin process is using the data directory.
|
||||
fs::path datadir = GetDataDir();
|
||||
if (!DirIsWritable(datadir)) {
|
||||
return InitError(strprintf(_("Cannot write to data directory '%s'; check permissions."), datadir.string()));
|
||||
}
|
||||
if (!LockDirectory(datadir, ".lock", probeOnly)) {
|
||||
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. %s is probably already running."), datadir.string(), _(PACKAGE_NAME)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user