Author: jerry Date: 2005-11-07 22:34:32 +0000 (Mon, 07 Nov 2005) New Revision: 11564
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=11564 Log: add a simple init function to the perfcounter code that will ensure that the $(lockdir)/perfmon/ gets created at smbd start time. Modified: trunk/source/registry/reg_frontend.c trunk/source/registry/reg_perfcount.c Changeset: Modified: trunk/source/registry/reg_frontend.c =================================================================== --- trunk/source/registry/reg_frontend.c 2005-11-07 22:17:03 UTC (rev 11563) +++ trunk/source/registry/reg_frontend.c 2005-11-07 22:34:32 UTC (rev 11564) @@ -131,6 +131,7 @@ svcctl_init_keys(); eventlog_init_keys(); + perfcount_init_keys(); /* close and let each smbd open up as necessary */ Modified: trunk/source/registry/reg_perfcount.c =================================================================== --- trunk/source/registry/reg_perfcount.c 2005-11-07 22:17:03 UTC (rev 11563) +++ trunk/source/registry/reg_perfcount.c 2005-11-07 22:34:32 UTC (rev 11564) @@ -27,6 +27,7 @@ #define PERFCOUNT_MAX_LEN 256 +#define PERFCOUNTDIR "perfmon" #define NAMES_DB "names.tdb" #define DATA_DB "data.tdb" @@ -41,7 +42,7 @@ if ( !dbname ) return NULL; - fstr_sprintf( path, "perfmon/%s", dbname ); + fstr_sprintf( path, "%s/%s", PERFCOUNTDIR, dbname ); pstrcpy( fname, lock_path( path ) ); @@ -51,6 +52,21 @@ /********************************************************************* *********************************************************************/ +void perfcount_init_keys( void ) +{ + char *p = lock_path(PERFCOUNTDIR); + + /* no registry keys; just create the perfmon directory */ + + if ( !directory_exist( p, NULL ) ) + mkdir( p, 0755 ); + + return; +} + +/********************************************************************* +*********************************************************************/ + uint32 reg_perfcount_get_base_index(void) { const char *fname = counters_directory( NAMES_DB );
