s3-perfcount: Create the directory on tdb open.
authorAndreas Schneider <asn@samba.org>
Wed, 2 Feb 2011 10:47:37 +0000 (11:47 +0100)
committerGünther Deschner <gd@samba.org>
Mon, 7 Feb 2011 11:32:02 +0000 (12:32 +0100)
Signed-off-by: Günther Deschner <gd@samba.org>
source3/registry/reg_init_full.c
source3/registry/reg_perfcount.c
source3/registry/reg_perfcount.h

index f14ffd0709d5b47562fb7e441c233f940185b4ff..e63dd9283dde4478d21579cad5d2c873551e978d 100644 (file)
@@ -95,9 +95,6 @@ WERROR registry_init_full(void)
        if ( DEBUGLEVEL >= 20 )
                reghook_dump_cache(20);
 
-       /* add any keys for other services */
-       perfcount_init_keys();
-
 fail:
        /* close and let each smbd open up as necessary */
        regdb_close();
index 6a9c1af61b7f4a0c2955a5234e6962fe88910874..d660dd0565b869fcc9156d9758d340cc7695e121 100644 (file)
@@ -44,6 +44,11 @@ static char *counters_directory(const char *dbname)
        char *ret = NULL;
        TALLOC_CTX *ctx = talloc_tos();
 
+       path = state_path(PERFCOUNTDIR);
+       if (!directory_exist(path)) {
+               mkdir(path, 0755);
+       }
+
        path = talloc_asprintf(ctx, "%s/%s", PERFCOUNTDIR, dbname);
        if (!path) {
                return NULL;
@@ -57,21 +62,6 @@ static char *counters_directory(const char *dbname)
 /*********************************************************************
 *********************************************************************/
 
-void perfcount_init_keys( void )
-{
-       char *p = state_path(PERFCOUNTDIR);
-
-       /* no registry keys; just create the perfmon directory */
-
-       if ( !directory_exist( p ) )
-               mkdir( p, 0755 );
-
-       return;
-}
-
-/*********************************************************************
-*********************************************************************/
-
 uint32 reg_perfcount_get_base_index(void)
 {
        const char *fname = counters_directory( NAMES_DB );
index 671153f21c71866f171b13c4935f1420b9869735..515790ac52260d7bb419e5a592e2c58c0c00a70f 100644 (file)
@@ -24,7 +24,6 @@
 
 #include "reg_parse_prs.h"
 
-void perfcount_init_keys( void );
 uint32 reg_perfcount_get_base_index(void);
 uint32 reg_perfcount_get_last_counter(uint32 base_index);
 uint32 reg_perfcount_get_last_help(uint32 last_counter);