exit(EXIT_FAILURE);
}
-static int create_tables_callback(int fd, const struct osl_object *query)
+static int com_init_callback(int fd, const struct osl_object *query)
{
uint32_t table_mask = *(uint32_t *)query->data;
int i, ret;
if (!t->create)
continue;
ret = t->create(database_dir);
- if (ret < 0)
+ if (ret < 0) {
+ para_printf(&pb, "cannot create table %s\n", t->name);
goto out;
+ }
para_printf(&pb, "successfully created %s table\n", t->name);
}
ret = open_afs_tables();
-out:
if (ret < 0)
- para_printf(&pb, "%s\n", para_strerror(-ret));
+ para_printf(&pb, "cannot open afs tables\n");
+out:
flush_and_free_pb(&pb);
- return 0;
+ return ret;
}
int com_init(struct command_context *cc)
return -E_BAD_TABLE_NAME;
}
}
- return send_callback_request(create_tables_callback, &query,
+ return send_callback_request(com_init_callback, &query,
afs_cb_result_handler, cc);
}