yaz_log(YLOG_WARN, "Bad/missing root element for config %s",
control_block.xml_config);
return 0;
-
}
}
return ptr;
}
#endif
-static void xml_config_open(void)
+static int xml_config_open(void)
{
const char *last_p;
const char *fname = control_block.xml_config;
gfs_nmem = nmem_create();
#if YAZ_HAVE_XML2
if (fname[0] == '\0')
- return;
+ return 0;
if (!xml_config_doc)
{
if (!xml_config_doc)
{
yaz_log(YLOG_FATAL, "Could not parse %s", fname);
- exit(1);
+ return -1;
}
else
{
{
yaz_log(YLOG_WARN, "XInclude processing failed for config %s",
fname);
- exit(1);
+ return -1;
}
}
}
else
xml_config_read(0);
#endif
+ return 0;
}
static void xml_config_close(void)
#endif
}
-static void xml_config_add_listeners(void)
+static int xml_config_add_listeners(void)
{
struct gfs_listen *gfs = gfs_listen_list;
int id_no;
+ int ret = 0;
for (id_no = 1; gfs; gfs = gfs->next, id_no++)
{
- if (gfs->address)
- add_listener(gfs->address, id_no);
+ if (!ret && gfs->address)
+ ret = add_listener(gfs->address, id_no);
}
+ return ret;
}
static void xml_config_bend_start(void)
if (control_block.options_func(argc, argv))
return 1;
- xml_config_open();
+ if (xml_config_open())
+ return 1;
xml_config_bend_start();
}
else
{
- xml_config_add_listeners();
+ if (xml_config_add_listeners())
+ return 1;
if (!pListener)
add_listener("tcp:@:9999", 0);