aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2017-11-29 11:58:24 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2017-11-29 11:58:42 +0100
commite97039605e0de3ba9e2c266b21821e26c2437811 (patch)
tree27264c3bd731fc0b8f656d95ae4f7e088cc6ad36
parent26efc220a13aa3413f6e55e311e8991445104f82 (diff)
parente1a8ec56c56161be15af1c33067918959e2666de (diff)
Merge #11747: Fix: Open files read only if requested
e1a8ec5 Fix: Open files read only if requested (Andras Elso) Tree-SHA512: 047951bf3fa1272764596d2efed0a541105a6d3057789ba4218cd1bbce8a802cab0feac0ed3d28f6eab6b2e54e294d46f729dd0162d6d209e319d716c0567352
-rw-r--r--src/validation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 99ea1433f9..9d45ef5f81 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -3464,7 +3464,7 @@ static FILE* OpenDiskFile(const CDiskBlockPos &pos, const char *prefix, bool fRe
return nullptr;
fs::path path = GetBlockPosFilename(pos, prefix);
fs::create_directories(path.parent_path());
- FILE* file = fsbridge::fopen(path, "rb+");
+ FILE* file = fsbridge::fopen(path, fReadOnly ? "rb": "rb+");
if (!file && !fReadOnly)
file = fsbridge::fopen(path, "wb+");
if (!file) {