From fb4e0c586446e7ea858b9eea5262aa2729837fa5 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 8 May 2008 17:43:59 +0200 Subject: [PATCH] Revert "registry: change registry_init_basic() to return WERROR instead of bool" This reverts commit 6a31e659cb371395dff0906786f3c6ef0cc2b3de. --- source/libgpo/gpo_reg.c | 5 ++--- source/registry/reg_init_basic.c | 10 +++++----- source/utils/net_registry.c | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/source/libgpo/gpo_reg.c b/source/libgpo/gpo_reg.c index de4a7937ecf..80639b86c5d 100644 --- a/source/libgpo/gpo_reg.c +++ b/source/libgpo/gpo_reg.c @@ -60,9 +60,8 @@ WERROR gp_init_reg_ctx(TALLOC_CTX *mem_ctx, return WERR_INVALID_PARAM; } - werr = registry_init_basic(); - if (!W_ERROR_IS_OK(werr)) { - return werr; + if (!registry_init_basic()) { + return WERR_CAN_NOT_COMPLETE; } 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 cdf172c2899..72ab9d1e655 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 -WERROR registry_init_basic(void) +bool registry_init_basic(void) { WERROR werr; @@ -32,16 +32,16 @@ WERROR registry_init_basic(void) if (!W_ERROR_IS_OK(werr)) { DEBUG(1, ("Failed to initialize the registry: %s\n", dos_errstr(werr))); - goto done; + return false; } + 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; } -done: - regdb_close(); - return werr; + return true; } diff --git a/source/utils/net_registry.c b/source/utils/net_registry.c index 94a7d2d3594..421db6efbfe 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 (!W_ERROR_IS_OK(registry_init_basic())) { + if (!registry_init_basic()) { return -1; } -- 2.47.3