aboutsummaryrefslogtreecommitdiffstats
path: root/main/pbx.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-14 00:54:38 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-14 00:54:38 +0000
commitcdae4a5591b4f166891ae1c94842a3838dff6328 (patch)
treeea2278dbcdc050b8a4e5b2f72d5c58d988314aab /main/pbx.c
parentcc34f5c17ee680c37563223bee3d8880bebbc28c (diff)
use simpler technique for removing known entries from lists
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89259 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/pbx.c')
-rw-r--r--main/pbx.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/main/pbx.c b/main/pbx.c
index 72a2ffa2d..cd2b27c82 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -2103,17 +2103,11 @@ int ast_custom_function_unregister(struct ast_custom_function *acf)
return -1;
AST_RWLIST_WRLOCK(&acf_root);
- AST_RWLIST_TRAVERSE_SAFE_BEGIN(&acf_root, cur, acflist) {
- if (cur == acf) {
- AST_RWLIST_REMOVE_CURRENT(acflist);
- ast_verb(2, "Unregistered custom function %s\n", acf->name);
- break;
- }
- }
- AST_RWLIST_TRAVERSE_SAFE_END;
+ if ((cur = AST_RWLIST_REMOVE(&acf_root, acf, acflist)))
+ ast_verb(2, "Unregistered custom function %s\n", cur->name);
AST_RWLIST_UNLOCK(&acf_root);
- return acf ? 0 : -1;
+ return cur ? 0 : -1;
}
int __ast_custom_function_register(struct ast_custom_function *acf, struct ast_module *mod)