if (!dir_table)
return;
+ NOTICE_LOG("closing dir table\n");
ret = osl(osl_close_table(dir_table, OSL_MARK_CLEAN));
if (ret < 0)
ERROR_LOG("failed to close dir table: %s\n", adu_strerror(-ret));
int open_dir_table(int create)
{
+
+ if (dir_table)
+ return 1;
dir_table_desc.dir = adu_strdup(conf.database_dir_arg);
if (create) {
+ NOTICE_LOG("creating dir table\n");
int ret = osl(osl_create_table(&dir_table_desc));
if (ret < 0) {
free((char *)dir_table_desc.dir);
return ret;
}
}
+ INFO_LOG("opening dir table\n");
return osl(osl_open_table(&dir_table_desc, &dir_table));
}
if (ret < 0)
goto out;
out:
+ close_all_tables();
if (ret < 0) {
ERROR_LOG("%s\n", adu_strerror(-ret));
return -EXIT_FAILURE;