summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2012-03-24 16:41:35 +0100
committerJelmer Vernooij <jelmer@samba.org>2012-03-24 16:41:35 +0100
commit6f1b735cc2972ecd3d2acb30ff834273f08628fe (patch)
tree9a2545b0aebef9e867f57526c84c4710a06c9876
parent71d41a015add73e0fb355dd9713e99febd71d46f (diff)
downloadsamba-6f1b735cc2972ecd3d2acb30ff834273f08628fe.tar.gz
samba-6f1b735cc2972ecd3d2acb30ff834273f08628fe.tar.bz2
samba-6f1b735cc2972ecd3d2acb30ff834273f08628fe.zip
adt_tree: Avoid WERROR.
-rw-r--r--source3/include/adt_tree.h2
-rw-r--r--source3/lib/adt_tree.c6
-rw-r--r--source3/registry/reg_cachehook.c5
3 files changed, 8 insertions, 5 deletions
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);