diff options
| author | murrayn <[email protected]> | 2018-03-07 03:08:55 -0800 |
|---|---|---|
| committer | murrayn <[email protected]> | 2018-03-14 19:07:30 -0700 |
| commit | 8674e74b47c1f6e86a367cfbc738fcc9812b616b (patch) | |
| tree | acf9d52938e2021e4dcb9ad1c89e02ae8362d82a /src/init.cpp | |
| parent | Merge #11372: Address encoding cleanup (diff) | |
| download | discoin-8674e74b47c1f6e86a367cfbc738fcc9812b616b.tar.xz discoin-8674e74b47c1f6e86a367cfbc738fcc9812b616b.zip | |
Provide relevant error message if datadir is not writable.
Diffstat (limited to 'src/init.cpp')
| -rw-r--r-- | src/init.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp index f763c3a43..6493ae72b 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -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))); } |