From: Michael Adam Date: Sun, 13 Apr 2008 13:12:04 +0000 (+0200) Subject: registry: change registry_init_basic() to return WERROR instead of bool X-Git-Tag: samba-3.3.0pre1~2702 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6a31e659cb371395dff0906786f3c6ef0cc2b3de;p=thirdparty%2Fsamba.git registry: change registry_init_basic() to return WERROR instead of bool Michael --- diff --git a/source/libgpo/gpo_reg.c b/source/libgpo/gpo_reg.c index 80639b86c5d..de4a7937ecf 100644 --- a/source/libgpo/gpo_reg.c +++ b/source/libgpo/gpo_reg.c @@ -60,8 +60,9 @@ WERROR gp_init_reg_ctx(TALLOC_CTX *mem_ctx, return WERR_INVALID_PARAM; } - if (!registry_init_basic()) { - return WERR_CAN_NOT_COMPLETE; + werr = registry_init_basic(); + if (!W_ERROR_IS_OK(werr)) { + return werr; } tmp_ctx = TALLOC_ZERO_P(mem_ctx, struct gp_registry_context); diff --git a/source/registry/reg_init_basic.c b/source/registry/reg_init_basic.c index 72ab9d1e655..cdf172c2899 100644 --- a/source/registry/reg_init_basic.c +++ b/source/registry/reg_init_basic.c @@ -22,7 +22,7 @@ #undef DBGC_CLASS #define DBGC_CLASS DBGC_REGISTRY -bool registry_init_basic(void) +WERROR registry_init_basic(void) { WERROR werr; @@ -32,16 +32,16 @@ bool registry_init_basic(void) if (!W_ERROR_IS_OK(werr)) { DEBUG(1, ("Failed to initialize the registry: %s\n", dos_errstr(werr))); - return false; + goto done; } - regdb_close(); werr = reghook_cache_init(); if (!W_ERROR_IS_OK(werr)) { DEBUG(1, ("Failed to initialize the reghook cache: %s\n", dos_errstr(werr))); - return false; } - return true; +done: + regdb_close(); + return werr; } diff --git a/source/utils/net_registry.c b/source/utils/net_registry.c index 6af82360922..f6847f638d1 100644 --- a/source/utils/net_registry.c +++ b/source/utils/net_registry.c @@ -473,7 +473,7 @@ int net_registry(int argc, const char **argv) { NULL, NULL, NULL } }; - if (!registry_init_basic()) { + if (!W_ERROR_IS_OK(registry_init_basic())) { return -1; }