diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-10-31 20:31:42 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-10-31 20:31:42 +0200 |
commit | 75ad92c82c01961fc7bbac70a67087a5d61dbcf7 (patch) | |
tree | 65c3df9687577d53058a2d191541d59bc299b2b1 /src | |
parent | Merge pull request #2687 (diff) | |
parent | fixed an LMDB issue on OpenBSD (#2699) which leads to a crash in monerod (diff) | |
download | monero-75ad92c82c01961fc7bbac70a67087a5d61dbcf7.tar.xz |
Merge pull request #2702
f946bb7b fixed an LMDB issue on OpenBSD (#2699) which leads to a crash in monerod (ston1th)
Diffstat (limited to 'src')
-rw-r--r-- | src/blockchain_db/lmdb/db_lmdb.cpp | 6 |
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())); |