diff options
author | Andreas Schneider <asn@samba.org> | 2011-02-02 11:47:37 +0100 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2011-02-07 12:32:02 +0100 |
commit | a3ee831f2dda047d32750a8c7b4a30b6b7eb7519 (patch) | |
tree | 44f71b5cba94780db8bf00921fbe64cd0d34bbf4 /source3/registry/reg_perfcount.c | |
parent | 1c6276ce7a917d7599205e7b3f9640811c0be24b (diff) | |
download | samba-a3ee831f2dda047d32750a8c7b4a30b6b7eb7519.tar.gz samba-a3ee831f2dda047d32750a8c7b4a30b6b7eb7519.tar.xz samba-a3ee831f2dda047d32750a8c7b4a30b6b7eb7519.zip |
s3-perfcount: Create the directory on tdb open.
Signed-off-by: Günther Deschner <gd@samba.org>
Diffstat (limited to 'source3/registry/reg_perfcount.c')
-rw-r--r-- | source3/registry/reg_perfcount.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/source3/registry/reg_perfcount.c b/source3/registry/reg_perfcount.c index 6a9c1af61b7..d660dd0565b 100644 --- a/source3/registry/reg_perfcount.c +++ b/source3/registry/reg_perfcount.c @@ -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 ); |