commit fac4cc8c9ebc330e944ea3993d19288d4d2f16fb
parent 707d9803c6eeaa3542e2459cc2cf47370f007440
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Mon, 17 Aug 2026 17:05:08 +0200
if DB operation failed, return non-zero
Diffstat:
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/src/auditor/taler-auditor-dbinit.c b/src/auditor/taler-auditor-dbinit.c
@@ -77,21 +77,22 @@ run (void *cls,
global_ret = EXIT_NOTINSTALLED;
return;
}
- if (reset_db)
+ if (reset_db || restart_db)
{
+ /* '-R' subsumes '-r': dropping all tables also drops the
+ recoverable audit state that '-r' removes. */
if (GNUNET_OK !=
TALER_AUDITORDB_drop_tables (pg,
- true))
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Failed to reset database\n");
- }
- else if (restart_db)
- {
- if (GNUNET_OK !=
- TALER_AUDITORDB_drop_tables (pg,
- false))
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Failed to restart audits\n");
+ 0 != reset_db))
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ reset_db
+ ? "Failed to reset database\n"
+ : "Failed to restart audits\n");
+ TALER_AUDITORDB_disconnect (pg);
+ global_ret = EXIT_FAILURE;
+ return;
+ }
}
if (GNUNET_OK !=
TALER_AUDITORDB_create_tables (pg,
@@ -107,8 +108,11 @@ run (void *cls,
if (gc_db)
{
if (GNUNET_SYSERR == TALER_AUDITORDB_gc (pg))
+ {
fprintf (stderr,
"Garbage collection failed!\n");
+ global_ret = EXIT_FAILURE;
+ }
}
TALER_AUDITORDB_disconnect (pg);
}