From 997b0d9a9c6282b8f3e622291ab4fe63851f6142 Mon Sep 17 00:00:00 2001 From: Michael McVady Date: Wed, 25 May 2022 17:22:55 -0500 Subject: Don't start if failed to register database --- src/init.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/init.c') diff --git a/src/init.c b/src/init.c index 8a32cd0..0dbeada 100644 --- a/src/init.c +++ b/src/init.c @@ -6,12 +6,19 @@ void kore_parent_configure(int, char **); static const char *database = "db"; -/* Let kore handle the default option parsing. */ void kore_parent_configure(int argc, char **argv) { - init_db(); + int err = 0; + kore_default_getopt(argc, argv); + + err = init_db(); + if (err != KORE_RESULT_OK) { + kore_log(LOG_ERR, "Error registering the database."); + // FIXME How to terminate? + exit(1); + } } int -- cgit v1.2.3