db: decouple fatal reliance, have as impl defined function

`fatal` is defined in lightningd and has logfile dependencies etc.

Make it more generic by allowing declaration in the use file (wallet.c)
This commit is contained in:
niftynei
2022-03-01 11:22:15 -06:00
committed by Rusty Russell
parent b0829fc52a
commit 03c950bae8
6 changed files with 54 additions and 37 deletions

View File

@@ -1,9 +1,6 @@
#include "config.h"
#include <lightningd/log.h>
static void db_test_fatal(const char *fmt, ...);
#define db_fatal db_test_fatal
static void db_log_(struct log *log UNUSED, enum log_level level UNUSED, const struct node_id *node_id UNUSED, bool call_notifier UNUSED, const char *fmt UNUSED, ...)
{
}
@@ -59,7 +56,7 @@ bool wire_sync_write(int fd UNNEEDED, const void *msg TAKES UNNEEDED)
/* AUTOGENERATED MOCKS END */
static char *db_err;
static void db_test_fatal(const char *fmt, ...)
void db_fatal(const char *fmt, ...)
{
va_list ap;