At the same time, fix the wrong return value from journals_walk().
-/* Copyright (C) 2019 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/* Copyright (C) 2020 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
int journals_walk(knot_lmdb_db_t *db, journals_walk_cb_t cb, void *ctx)
{
if (!knot_lmdb_exists(db)) {
- return KNOT_EOK;
+ return KNOT_EFILE;
}
int ret = knot_lmdb_open(db);
if (ret != KNOT_EOK) {
-/* Copyright (C) 2019 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
+/* Copyright (C) 2020 CZ.NIC, z.s.p.o. <knot-dns@labs.nic.cz>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
// FALLTHROUGH
case KNOT_EOK:
return EXIT_SUCCESS;
+ case KNOT_EFILE:
+ fprintf(stderr, "The specified journal DB is invalid\n");
+ return EXIT_FAILURE;
case KNOT_EMALF:
fprintf(stderr, "The journal DB is broken\n");
return EXIT_FAILURE;