+static void get_database_dir_or_die(void)
+{
+ char *tmp;
+
+ if (conf.database_dir_given)
+ tmp = adu_strdup(conf.database_dir_arg);
+ else
+ tmp = make_message("%s%s",
+ conf.database_root_arg, conf.base_dir_arg);
+ /*
+ * As we change the cwd during database creation, database_dir
+ * must be an absolute path.
+ */
+ database_dir = absolute_path(tmp);
+ free(tmp);
+ if (database_dir)
+ return;
+ EMERG_LOG("failed to get absolute path of database dir\n");
+ exit(EXIT_FAILURE);
+}
+
+/**
+ * The main function of adu.
+ *
+ * \param argc Usual argument count.
+ * \param argv Usual argument vector.
+ *
+ * Check command line options, init the signal handlers and
+ * call the main function of the selected mode.
+ *
+ * \return \p EXIT_SUCCESS on success, \p EXIT_FAILURE otherwise.
+ */