From 6f1b735cc2972ecd3d2acb30ff834273f08628fe Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 24 Mar 2012 16:41:35 +0100 Subject: adt_tree: Avoid WERROR. --- source3/include/adt_tree.h | 2 +- source3/lib/adt_tree.c | 6 +++--- source3/registry/reg_cachehook.c | 5 ++++- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'source3') diff --git a/source3/include/adt_tree.h b/source3/include/adt_tree.h index c2a869b0f2..7e43fa60f6 100644 --- a/source3/include/adt_tree.h +++ b/source3/include/adt_tree.h @@ -32,7 +32,7 @@ struct sorted_tree *pathtree_init(void *data_p); /* add a new path component */ -WERROR pathtree_add(struct sorted_tree *tree, const char *path, void *data_p ); +bool pathtree_add(struct sorted_tree *tree, const char *path, void *data_p ); /* search path */ diff --git a/source3/lib/adt_tree.c b/source3/lib/adt_tree.c index de7f2d2637..a225796fc7 100644 --- a/source3/lib/adt_tree.c +++ b/source3/lib/adt_tree.c @@ -206,11 +206,11 @@ static struct tree_node *pathtree_find_child(struct tree_node *node, Add a new node into the tree given a key path and a blob of data *************************************************************************/ -WERROR pathtree_add(struct sorted_tree *tree, const char *path, void *data_p) +bool pathtree_add(struct sorted_tree *tree, const char *path, void *data_p) { char *str, *base, *path2; struct tree_node *current, *next; - WERROR ret = WERR_OK; + bool ret = true; DEBUG(8,("pathtree_add: Enter\n")); @@ -259,7 +259,7 @@ WERROR pathtree_add(struct sorted_tree *tree, const char *path, void *data_p) next = pathtree_birth_child( current, base ); if ( !next ) { DEBUG(0,("pathtree_add: Failed to create new child!\n")); - ret = WERR_NOMEM; + ret = false; goto done; } } diff --git a/source3/registry/reg_cachehook.c b/source3/registry/reg_cachehook.c index dc07b51944..1f269276aa 100644 --- a/source3/registry/reg_cachehook.c +++ b/source3/registry/reg_cachehook.c @@ -93,7 +93,10 @@ WERROR reghook_cache_add(const char *keyname, struct registry_ops *ops) DEBUG(10, ("reghook_cache_add: Adding ops %p for key [%s]\n", (void *)ops, key)); - werr = pathtree_add(cache_tree, key, ops); + if (!pathtree_add(cache_tree, key, ops)) + werr = WERR_NOMEM; + else + werr = WERR_OK; done: TALLOC_FREE(key); -- cgit