From 9774af4358e653111ea37a331a93249aede3eb3d Mon Sep 17 00:00:00 2001 From: Jonathan McDowell Date: Fri, 31 Oct 2025 19:05:59 +0000 Subject: [PATCH] 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. --- keydb/keydb_db4.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); -- 2.39.5