aboutsummaryrefslogtreecommitdiff
path: root/src/blockchain_db/lmdb
diff options
context:
space:
mode:
authorston1th <ston1th@giftfish.de>2017-10-22 13:38:19 +0200
committerston1th <ston1th@giftfish.de>2017-10-26 17:16:06 +0200
commitf946bb7be6ec434dddf9a5d2fb1903609a514dd2 (patch)
tree2e4dcb1b570c930d151c5433446b242a4dc7e18e /src/blockchain_db/lmdb
parentMerge pull request #2601 (diff)
downloadmonero-f946bb7be6ec434dddf9a5d2fb1903609a514dd2.tar.xz
fixed an LMDB issue on OpenBSD (#2699) which leads to a crash in monerod
Diffstat (limited to 'src/blockchain_db/lmdb')
-rw-r--r--src/blockchain_db/lmdb/db_lmdb.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/blockchain_db/lmdb/db_lmdb.cpp b/src/blockchain_db/lmdb/db_lmdb.cpp
index 3979a5edf..5bd02bcf7 100644
--- a/src/blockchain_db/lmdb/db_lmdb.cpp
+++ b/src/blockchain_db/lmdb/db_lmdb.cpp
@@ -1123,6 +1123,12 @@ void BlockchainLMDB::open(const std::string& filename, const int db_flags)
m_folder = filename;
+#ifdef __OpenBSD__
+ if ((mdb_flags & MDB_WRITEMAP) == 0) {
+ MCLOG_RED(el::Level::Info, "global", "Running on OpenBSD: forcing WRITEMAP");
+ mdb_flags |= MDB_WRITEMAP;
+ }
+#endif
// set up lmdb environment
if ((result = mdb_env_create(&m_env)))
throw0(DB_ERROR(lmdb_error("Failed to create lmdb environment: ", result).c_str()));