diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-10-02 21:36:21 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-10-02 21:36:21 +0200 |
commit | 3c024e7b3170bd2d3869a404b08bc20345bc6f81 (patch) | |
tree | 82ba48b803807dac4904773194d99794858857ce /utils.c | |
parent | fd50535d7d4060d3cb80f1c317a087507ecfdf2b (diff) |
add a new vlist flag for avoiding automatic delete of entries
Diffstat (limited to 'utils.c')
-rw-r--r-- | utils.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -21,7 +21,8 @@ __vlist_init(struct vlist_tree *tree, avl_tree_comp cmp, void vlist_delete(struct vlist_tree *tree, struct vlist_node *node) { - avl_delete(&tree->avl, &node->avl); + if (!tree->no_delete) + avl_delete(&tree->avl, &node->avl); tree->update(tree, NULL, node); } @@ -37,7 +38,7 @@ vlist_add(struct vlist_tree *tree, struct vlist_node *node) anode = avl_find(&tree->avl, key); if (anode) { - if (tree->keep_old) + if (tree->keep_old || !tree->no_delete) goto update_only; old_node = container_of(anode, struct vlist_node, avl); |