]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
registry: change registry_init_basic() to return WERROR instead of bool
authorMichael Adam <obnox@samba.org>
Sun, 13 Apr 2008 13:12:04 +0000 (15:12 +0200)
committerMichael Adam <obnox@samba.org>
Sun, 13 Apr 2008 13:33:48 +0000 (15:33 +0200)
Michael

source/libgpo/gpo_reg.c
source/registry/reg_init_basic.c
source/utils/net_registry.c

index 80639b86c5d704f7d65b26945d8043866626df52..de4a7937ecf7db7bc20c539a8f4b583aa7891a14 100644 (file)
@@ -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);
index 72ab9d1e655f7c32e85105ef15c57dcd5193bc84..cdf172c2899b5e50ca5d7553790bf829fba8214d 100644 (file)
@@ -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;
 }
index 6af823609224af870403909aa7a60d836eaaeaee..f6847f638d1ff85435e421f13fe5b495fdbde3b0 100644 (file)
@@ -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;
        }