diff options
author | ston1th <ston1th@giftfish.de> | 2017-10-22 13:38:19 +0200 |
---|---|---|
committer | ston1th <ston1th@giftfish.de> | 2017-10-26 17:16:06 +0200 |
commit | f946bb7be6ec434dddf9a5d2fb1903609a514dd2 (patch) | |
tree | 2e4dcb1b570c930d151c5433446b242a4dc7e18e /src | |
parent | Merge pull request #2601 (diff) | |
download | monero-f946bb7be6ec434dddf9a5d2fb1903609a514dd2.tar.xz |
fixed an LMDB issue on OpenBSD (#2699) which leads to a crash in monerod
Diffstat (limited to '')
-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())); |