aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael McVady <femtonaut@gmail.com>2022-05-25 17:22:55 -0500
committerMichael McVady <femtonaut@gmail.com>2022-05-25 17:22:55 -0500
commit997b0d9a9c6282b8f3e622291ab4fe63851f6142 (patch)
treeb3ea4c30a4dc4f8321395ad5ecbe003355d5eb45
parent197c6663712ce20d693c693d54cafdbded8c2f3e (diff)
Don't start if failed to register database
-rw-r--r--src/init.c11
1 files changed, 9 insertions, 2 deletions
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