From: Jonathan McDowell Date: Fri, 31 Oct 2025 19:05:59 +0000 (+0000) Subject: Make DB4 backend quieter when num_keydb file is missing X-Git-Url: https://the.earth.li/gitweb/?a=commitdiff_plain;h=9774af4358e653111ea37a331a93249aede3eb3d;p=onak.git Make DB4 backend quieter when num_keydb file is missing This file tells us how many DB4 files we're sharding across for actual key storage. If it's not found, we create it. Only log an error if it's not that the file doesn't exist. --- diff --git a/keydb/keydb_db4.c b/keydb/keydb_db4.c index 35fcdd1..2b970ad 100644 --- a/keydb/keydb_db4.c +++ b/keydb/keydb_db4.c @@ -1489,9 +1489,10 @@ struct onak_dbctx *keydb_db4_init(struct onak_db_config *dbcfg, bool readonly) privctx->numdbs = atoi(buf); } fclose(numdb); - } else if (!readonly) { + } else if (errno != ENOENT) { logthing(LOGTHING_ERROR, "Couldn't open num_keydb: %s", strerror(errno)); + } else if (!readonly) { numdb = fopen(buf, "w"); if (numdb != NULL) { fprintf(numdb, "%d", privctx->numdbs);