X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=src%2Fpazpar2_config.c;h=075347eadfab8aafbb7241b52147d2c0e3366b4c;hb=3c787972fe8ea6931db1ecf13783b00964f326bc;hp=ab4382b6b3d1b8a4d6fa97bf565f196c58fd74c7;hpb=7f725d287c1f048367de28c121b02132c3fbfca7;p=pazpar2-moved-to-github.git diff --git a/src/pazpar2_config.c b/src/pazpar2_config.c index ab4382b..075347e 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,