diff options
Diffstat (limited to 'source3')
-rw-r--r-- | source3/registry/reg_perfcount.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source3/registry/reg_perfcount.c b/source3/registry/reg_perfcount.c index 5b5489739f..a0edf4513f 100644 --- a/source3/registry/reg_perfcount.c +++ b/source3/registry/reg_perfcount.c @@ -1031,10 +1031,10 @@ uint32 reg_perfcount_get_perf_data_block(uint32 base_index, PERF_DATA_BLOCK *block, char *object_ids) { - uint32 buffer_size = 0, last_counter; + uint32 buffer_size = 0; const char *fname = counters_directory( NAMES_DB ); TDB_CONTEXT *names; - int retval; + int retval = 0; names = tdb_open_log(fname, 0, TDB_DEFAULT, O_RDONLY, 0444); @@ -1050,7 +1050,7 @@ uint32 reg_perfcount_get_perf_data_block(uint32 base_index, return 0; } - last_counter = reg_perfcount_get_last_counter(base_index); + reg_perfcount_get_last_counter(base_index); if(object_ids == NULL) { @@ -1066,6 +1066,10 @@ uint32 reg_perfcount_get_perf_data_block(uint32 base_index, tdb_close(names); + if (retval == -1) { + return 0; + } + return buffer_size + block->HeaderLength; } |