/*
- * Copyright (C) 2008 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2008 Andre Noll <maan@tuebingen.mpg.de>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
va_end(argp);
}
+/**
+ * adu's version of strerror(3).
+ *
+ * \param num The error number.
+ *
+ * \return The error text of \a num.
+ */
+const char *adu_strerror(int num)
+{
+ assert(num > 0);
+ if (num == E_OSL) {
+ assert(osl_errno > 0);
+ return osl_strerror((osl_errno));
+ }
+ if (IS_SYSTEM_ERROR(num))
+ return strerror((num) & ((1 << SYSTEM_ERROR_BIT) - 1));
+ return adu_errlist[num];
+}
+
static void close_dir_table(void)
{
int ret;
if (conf.database_dir_given)
tmp = adu_strdup(conf.database_dir_arg);
- else
+ else {
+ if (!conf.base_dir_arg) {
+ EMERG_LOG("fatal: neither database dir "
+ "nor base dir given\n");
+ exit(EXIT_FAILURE);
+ }
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.