From: Miod Vallat Date: Thu, 23 Jul 2026 13:47:35 +0000 (+0200) Subject: Make sure lines outputting to cerr are passive. X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fcb43ee34b6f7fee4b2be375408e4c660e14deb5;p=thirdparty%2Fpdns.git Make sure lines outputting to cerr are passive. (i.e. they don't invoke lmdb function). This will make easier to replace them with structured logging or whatever in a hypothetical future. Signed-off-by: Miod Vallat --- diff --git a/modules/lmdbbackend/lmdbbackend.cc b/modules/lmdbbackend/lmdbbackend.cc index b07dc95944..278f3bc0e5 100644 --- a/modules/lmdbbackend/lmdbbackend.cc +++ b/modules/lmdbbackend/lmdbbackend.cc @@ -466,7 +466,8 @@ bool LMDBBackend::upgradeToSchemav5(std::string& filename) throw std::runtime_error("copyDBIAndAddLSHeader failed"); } - cerr << "shard mbd_drop=" << mdb_drop(shtxn, shdbi, 1) << endl; + int rc = mdb_drop(shtxn, shdbi, 1); + cerr << "shard mbd_drop=" << rc << endl; mdb_txn_commit(shtxn); mdb_dbi_close(shenv, shdbi2); } @@ -634,7 +635,8 @@ bool LMDBBackend::upgradeToSchemav5(std::string& filename) mdb_drop(txn, fromindexdbi[i], 1); } - cerr << "txn commit=" << mdb_txn_commit(txn) << endl; + int rc = mdb_txn_commit(txn); + cerr << "txn commit=" << rc << endl; for (int i = 0; i < 4; i++) { // NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-constant-array-index)