summaryrefslogtreecommitdiff
path: root/source3/registry/reg_perfcount.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-06-28 18:22:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:19:05 -0500
commit7d6856240b64315d99576f059c443d082ec63dc9 (patch)
treeb8d44a5c4b102acf323ab2c2d3157e45771b60b0 /source3/registry/reg_perfcount.c
parent6a9b101dd66eebbc8dc65c971d30a73e34b622b9 (diff)
downloadsamba-7d6856240b64315d99576f059c443d082ec63dc9.tar.gz
samba-7d6856240b64315d99576f059c443d082ec63dc9.tar.bz2
samba-7d6856240b64315d99576f059c443d082ec63dc9.zip
r16636: Fix bug #3884 reported by jason@ncac.gwu.edu
Jeremy. (This used to be commit 7580eb947cdeb786be00efa5da727e32b28c99d6)
Diffstat (limited to 'source3/registry/reg_perfcount.c')
-rw-r--r--source3/registry/reg_perfcount.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/source3/registry/reg_perfcount.c b/source3/registry/reg_perfcount.c
index c69e7b7e14..5b5489739f 100644
--- a/source3/registry/reg_perfcount.c
+++ b/source3/registry/reg_perfcount.c
@@ -372,7 +372,7 @@ static BOOL _reg_perfcount_add_object(PERF_DATA_BLOCK *block,
TDB_CONTEXT *names)
{
int i;
- BOOL success = False;
+ BOOL success = True;
PERF_OBJECT_TYPE *obj;
block->objects = (PERF_OBJECT_TYPE *)TALLOC_REALLOC_ARRAY(ps->mem_ctx,
@@ -397,12 +397,11 @@ static BOOL _reg_perfcount_add_object(PERF_DATA_BLOCK *block,
block->objects[block->NumObjectTypes].DetailLevel = PERF_DETAIL_NOVICE;
block->NumObjectTypes+=1;
- for(i = 0; i < (int)obj->NumInstances; i++)
- {
+ for(i = 0; i < (int)obj->NumInstances; i++) {
success = _reg_perfcount_add_instance(obj, ps, i, names);
}
- return True;
+ return success;
}
/*********************************************************************
@@ -608,7 +607,7 @@ static BOOL _reg_perfcount_add_counter(PERF_DATA_BLOCK *block,
char *begin, *end, *start, *stop;
int parent;
PERF_OBJECT_TYPE *obj;
- BOOL success = False;
+ BOOL success = True;
char buf[PERFCOUNT_MAX_LEN];
obj = NULL;
@@ -620,8 +619,7 @@ static BOOL _reg_perfcount_add_counter(PERF_DATA_BLOCK *block,
return False;
start = begin+1;
- while(start < end)
- {
+ while(start < end) {
stop = index(start, ',');
if(stop == NULL)
stop = end;
@@ -629,8 +627,7 @@ static BOOL _reg_perfcount_add_counter(PERF_DATA_BLOCK *block,
parent = atoi(start);
obj = _reg_perfcount_find_obj(block, parent);
- if(obj == NULL)
- {
+ if(obj == NULL) {
/* At this point we require that the parent object exist.
This can probably be handled better at some later time */
DEBUG(3, ("_reg_perfcount_add_counter: Could not find parent object [%d] for counter [%d].\n",
@@ -657,7 +654,7 @@ static BOOL _reg_perfcount_add_counter(PERF_DATA_BLOCK *block,
that the required instances are not there yet, so change NumInstances from
PERF_NO_INSTANCES to 0 */
- return True;
+ return success;
}
/*********************************************************************
@@ -755,13 +752,9 @@ BOOL _reg_perfcount_add_instance(PERF_OBJECT_TYPE *obj,
int instInd,
TDB_CONTEXT *names)
{
- BOOL success;
PERF_INSTANCE_DEFINITION *inst;
- success = False;
-
- if(obj->instances == NULL)
- {
+ if(obj->instances == NULL) {
obj->instances = TALLOC_REALLOC_ARRAY(ps->mem_ctx,
obj->instances,
PERF_INSTANCE_DEFINITION,
@@ -772,9 +765,7 @@ BOOL _reg_perfcount_add_instance(PERF_OBJECT_TYPE *obj,
memset(&(obj->instances[instInd]), 0, sizeof(PERF_INSTANCE_DEFINITION));
inst = &(obj->instances[instInd]);
- success = _reg_perfcount_get_instance_info(inst, ps, instInd, obj, names);
-
- return True;
+ return _reg_perfcount_get_instance_info(inst, ps, instInd, obj, names);
}
/*********************************************************************