]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Revert "registry: refactor common part of registry initialization out."
authorMichael Adam <obnox@samba.org>
Thu, 8 May 2008 15:43:59 +0000 (17:43 +0200)
committerMichael Adam <obnox@samba.org>
Thu, 8 May 2008 15:43:59 +0000 (17:43 +0200)
This reverts commit 5da52b95ac69e4abfbc44335df2447bec8f16e13.

source/registry/reg_init_basic.c
source/registry/reg_init_full.c
source/registry/reg_init_smbconf.c

index c5e2c346b0c649dc6c19de8413c8fb0ef5e3882a..cdf172c2899b5e50ca5d7553790bf829fba8214d 100644 (file)
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_REGISTRY
 
-WERROR registry_init_common(void)
+WERROR registry_init_basic(void)
 {
        WERROR werr;
 
+       DEBUG(10, ("registry_init_basic called\n"));
+
        werr = regdb_init();
        if (!W_ERROR_IS_OK(werr)) {
-               DEBUG(0, ("Failed to initialize the registry: %s\n",
+               DEBUG(1, ("Failed to initialize the registry: %s\n",
                          dos_errstr(werr)));
                goto done;
        }
 
        werr = reghook_cache_init();
        if (!W_ERROR_IS_OK(werr)) {
-               DEBUG(0, ("Failed to initialize the reghook cache: %s\n",
+               DEBUG(1, ("Failed to initialize the reghook cache: %s\n",
                          dos_errstr(werr)));
        }
 
 done:
-       return werr;
-}
-
-WERROR registry_init_basic(void)
-{
-       WERROR werr;
-
-       DEBUG(10, ("registry_init_basic called\n"));
-
-       werr = registry_init_common();
        regdb_close();
        return werr;
 }
index 91e55d76b24f3d77594893e724ea283896caf466..da63453cd703bb3c7a77b9f0829b2907da62b20d 100644 (file)
@@ -67,8 +67,10 @@ WERROR registry_init_full(void)
        int i;
        WERROR werr;
 
-       werr = registry_init_common();
+       werr = regdb_init();
        if (!W_ERROR_IS_OK(werr)) {
+               DEBUG(0, ("Failed to initialize the registry: %s\n",
+                         dos_errstr(werr)));
                goto fail;
        }
 
@@ -82,6 +84,13 @@ WERROR registry_init_full(void)
 
        /* build the cache tree of registry hooks */
 
+       werr = reghook_cache_init();
+       if (!W_ERROR_IS_OK(werr)) {
+               DEBUG(0, ("Failed to initialize the reghook cache: %s\n",
+                         dos_errstr(werr)));
+               goto fail;
+       }
+
        for ( i=0; reg_hooks[i].keyname; i++ ) {
                werr = reghook_cache_add(reg_hooks[i].keyname, reg_hooks[i].ops);
                if (!W_ERROR_IS_OK(werr)) {
index a05da854cfb84c80807514a1e9aa7341829ef862..fafaf7952f6f691e36a59a5b4e900b6b784b5bfc 100644 (file)
@@ -80,8 +80,10 @@ bool registry_init_smbconf(const char *keyname)
                keyname = KEY_SMBCONF;
        }
 
-       werr = registry_init_common();
+       werr = regdb_init();
        if (!W_ERROR_IS_OK(werr)) {
+               DEBUG(1, ("Failed to initialize the registry: %s\n",
+                         dos_errstr(werr)));
                goto done;
        }
 
@@ -92,6 +94,13 @@ bool registry_init_smbconf(const char *keyname)
                goto done;
        }
 
+       werr = reghook_cache_init();
+       if (!W_ERROR_IS_OK(werr)) {
+               DEBUG(1, ("Failed to initialize the reghook cache: %s\n",
+                         dos_errstr(werr)));
+               goto done;
+       }
+
        werr = reghook_cache_add(keyname, &smbconf_reg_ops);
        if (!W_ERROR_IS_OK(werr)) {
                DEBUG(1, ("Failed to add smbconf reghooks to reghook cache: "