[FIX] Fix minor DB fuckup with tools

Used to open a flatfile database whenever it couldn't find an LMDB one,
which obviously caused *problems*
This commit is contained in:
lda 2025-02-08 08:45:21 +00:00
commit 1936be0078
2 changed files with 20 additions and 21 deletions

View file

@ -89,8 +89,12 @@ Main(Array *args, HashMap *env)
glob = ArrayGet(args, 2);
parsee = GetDB(db_path);
if (parsee)
if (!parsee)
{
Log(LOG_ERR, "%s: couldn't open config '%s' or couldnt edit DB", exec, db_path);
(void) env;
return EXIT_FAILURE;
}
if (glob)
{
@ -112,8 +116,3 @@ Main(Array *args, HashMap *env)
DbClose(parsee);
return EXIT_SUCCESS;
}
Log(LOG_ERR, "%s: couldn't open config '%s' or couldnt edit DB", exec, db_path);
(void) env;
return EXIT_FAILURE;
}

View file

@ -108,7 +108,7 @@ GetDB(char *config)
{
ret = DbOpenLMDB(db_path, lmdb_size);
}
if (!ret)
else
{
ret = DbOpen(db_path, 0);
}