- if (rGroupDef.databaseName)
- {
- if (zebra_select_database (zh, rGroupDef.databaseName))
- {
- logf(LOG_FATAL, "Could not select database %s errCode=%d",
- rGroupDef.databaseName, zebra_errCode(zh) );
- exit (1);
- }
- }
- else
- {
- if (zebra_select_database (zh, "Default"))
- {
- logf(LOG_FATAL, "Could not select database Default errCode=%d",
- zebra_errCode(zh) );
- exit (1);
- }
- }
- if (mem_max)
- zebra_set_resource(zh, "memmax",mem_max);
-
+ if (database &&
+ zebra_select_database (zh, database) == ZEBRA_FAIL)
+ {
+ yaz_log(YLOG_FATAL, "Could not select database %s "
+ "errCode=%d",
+ database, zebra_errCode(zh) );
+ exit (1);
+ }