From 8cb4461044d3020736d985012e4beb9c5db358ad Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 15 May 2008 02:08:14 +0200 Subject: loadparm: refactor processing of service out of process_registry_globals() into new function process_registry_service(). Michael (This used to be commit 2986e5174e69527465ae7ef8e108110416752b56) --- source3/param/loadparm.c | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ee19a38013..5774b22795 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6507,6 +6507,26 @@ static struct smbconf_ctx *lp_smbconf_ctx(void) return conf_ctx; } +static bool process_registry_service(struct smbconf_service *service) +{ + uint32_t count; + bool ret; + + if (service == NULL) { + return false; + } + + for (count = 0; count < service->num_params; count++) { + ret = do_parameter(service->param_names[count], + service->param_values[count], + NULL); + if (ret != true) { + return false; + } + } + return true; +} + /* * process_registry_globals */ @@ -6514,7 +6534,6 @@ static bool process_registry_globals(void) { WERROR werr; struct smbconf_service *service = NULL; - uint32_t count; TALLOC_CTX *mem_ctx = talloc_stackframe(); struct smbconf_ctx *conf_ctx = lp_smbconf_ctx(); bool ret = false; @@ -6535,13 +6554,9 @@ static bool process_registry_globals(void) goto done; } - for (count = 0; count < service->num_params; count++) { - ret = do_parameter(service->param_names[count], - service->param_values[count], - NULL); - if (ret != true) { - goto done; - } + ret = process_registry_service(service); + if (!ret) { + goto done; } ret = do_parameter("registry shares", "yes", NULL); -- cgit