registry: unify debug output in the registry init functions.
[kai/samba.git] / source3 / registry / reg_init_full.c
index ad245cb52e95bbb14d2bcf093e70b06fa8178f59..04eff3605789dce12bc78cdff6afc05232dac731 100644 (file)
@@ -65,19 +65,20 @@ REGISTRY_HOOK reg_hooks[] = {
 bool init_registry( void )
 {
        int i;
+       WERROR werr;
        bool ret = false;
 
-       if ( !regdb_init() ) {
-               DEBUG(0, ("init_registry: failed to initialize the registry "
-                         "tdb!\n"));
+       werr = regdb_init();
+       if (!W_ERROR_IS_OK(werr)) {
+               DEBUG(0, ("Failed to initialize the registry: %s\n",
+                         dos_errstr(werr)));
                goto fail;
        }
 
        /* setup the necessary keys and values */
 
        if ( !init_registry_data() ) {
-               DEBUG(0, ("regdb_init: Failed to initialize data in "
-                         "registry!\n"));
+               DEBUG(0, ("Failed to initialize data in registry!\n"));
                goto fail;
        }
 
@@ -86,7 +87,7 @@ bool init_registry( void )
        reghook_cache_init();
 
        for ( i=0; reg_hooks[i].keyname; i++ ) {
-               if ( !reghook_cache_add(&reg_hooks[i]) )
+               if (!reghook_cache_add(reg_hooks[i].keyname, reg_hooks[i].ops))
                        goto fail;
        }