X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fpazpar2_config.c;h=bff5810edb365ff88318e491e31f08dc44994cef;hb=6424430743ec2d233dfc8118313cfa4299432e2c;hp=0a67bee195c03fa9d977858203a96816eef71e77;hpb=960132e07ebd3a77da7500cf1f45819b7de390e1;p=pazpar2-moved-to-github.git diff --git a/src/pazpar2_config.c b/src/pazpar2_config.c index 0a67bee..bff5810 100644 --- a/src/pazpar2_config.c +++ b/src/pazpar2_config.c @@ -607,19 +607,22 @@ static struct conf_service *service_create_static(struct conf_server *server, continue; if (!strcmp((const char *) n->name, "settings")) { + int ret; xmlChar *src = xmlGetProp(n, (xmlChar *) "src"); if (src) { WRBUF w = wrbuf_alloc(); conf_dir_path(server->config, w, (const char *) src); - settings_read_file(service, wrbuf_cstr(w), pass); + ret = settings_read_file(service, wrbuf_cstr(w), pass); wrbuf_destroy(w); xmlFree(src); } else { - settings_read_node(service, n, pass); + ret = settings_read_node(service, n, pass); } + if (ret) + return 0; } } } @@ -627,8 +630,9 @@ static struct conf_service *service_create_static(struct conf_server *server, return service; } -static void inherit_server_settings(struct conf_service *s) +static int inherit_server_settings(struct conf_service *s) { + int ret = 0; struct conf_server *server = s->server; if (!s->dictionary) /* service has no config settings ? */ { @@ -636,8 +640,10 @@ static void inherit_server_settings(struct conf_service *s) { /* inherit settings from server */ init_settings(s); - settings_read_file(s, server->settings_fname, 1); - settings_read_file(s, server->settings_fname, 2); + if (settings_read_file(s, server->settings_fname, 1)) + ret = -1; + if (settings_read_file(s, server->settings_fname, 2)) + ret = -1; } else { @@ -660,6 +666,7 @@ static void inherit_server_settings(struct conf_service *s) s->charsets = pp2_charset_fact_create(); } } + return ret; } struct conf_service *service_create(struct conf_server *server,