1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

adt_tree: Avoid WERROR.

This commit is contained in:
Jelmer Vernooij 2012-03-24 16:41:35 +01:00
parent 71d41a015a
commit 6f1b735cc2
3 changed files with 8 additions and 5 deletions

View File

@ -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 */

View File

@ -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;
}
}

View File

@ -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);