aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/linkedlists.h
diff options
context:
space:
mode:
authormogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-22 20:13:05 +0000
committermogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b>2006-02-22 20:13:05 +0000
commit48848cc51d1f33ca5034eb8d1cd8a9e1e041f96c (patch)
treeed2aa1249accf3390478d56d3f3a9618e50ff3aa /include/asterisk/linkedlists.h
parent31e7dd9226e1ec217c8e03dcb13801c8e995d256 (diff)
bug in the linkedlists macros where the prev node
was improperly managed when doing removals or insertions. also solved issues with app_voicemail init. and reload solves bug #6557 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@10766 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/linkedlists.h')
-rw-r--r--include/asterisk/linkedlists.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/asterisk/linkedlists.h b/include/asterisk/linkedlists.h
index 49dd3a10d..17d92c57a 100644
--- a/include/asterisk/linkedlists.h
+++ b/include/asterisk/linkedlists.h
@@ -298,9 +298,11 @@ struct { \
#define AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field) { \
typeof((head)->first) __list_next; \
typeof((head)->first) __list_prev = NULL; \
- for ((var) = (head)->first, __list_next = (var) ? (var)->field.next : NULL; \
+ typeof((head)->first) __new_prev = NULL; \
+ for ((var) = (head)->first, __new_prev = (var), \
+ __list_next = (var) ? (var)->field.next : NULL; \
(var); \
- __list_prev = (var), (var) = __list_next, \
+ __list_prev = __new_prev, (var) = __list_next, \
__list_next = (var) ? (var)->field.next : NULL \
)
@@ -316,6 +318,7 @@ struct { \
previous entry, if any).
*/
#define AST_LIST_REMOVE_CURRENT(head, field) \
+ __new_prev = __list_prev; \
if (__list_prev) \
__list_prev->field.next = __list_next; \
else \
@@ -340,7 +343,8 @@ struct { \
} else { \
(elm)->field.next = (head)->first; \
(head)->first = (elm); \
- } \
+ } \
+ __new_prev = (elm); \
} while (0)
/*!