]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Make sure lines outputting to cerr are passive.
authorMiod Vallat <miod.vallat@powerdns.com>
Thu, 23 Jul 2026 13:47:35 +0000 (15:47 +0200)
committerMiod Vallat <miod.vallat@powerdns.com>
Thu, 23 Jul 2026 13:59:42 +0000 (15:59 +0200)
(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 <miod.vallat@powerdns.com>
modules/lmdbbackend/lmdbbackend.cc

index b07dc959447fe8345d86edcf02af7c60411ac87f..278f3bc0e56082cab7e5e8deb49a9e5e72663a2a 100644 (file)
@@ -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)