mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 19:52:48 +00:00
Fix channel variables on cloned channels (bug #3804)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5222 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -229,21 +229,23 @@ struct { \
|
|||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief Inserts a list entry at the tail of a list.
|
\brief Appends a list entry to the tail of a list.
|
||||||
\param head This is a pointer to the list head structure
|
\param head This is a pointer to the list head structure
|
||||||
\param elm This is a pointer to the entry to be inserted.
|
\param elm This is a pointer to the entry to be appended.
|
||||||
\param field This is the name of the field (declared using AST_LIST_ENTRY())
|
\param field This is the name of the field (declared using AST_LIST_ENTRY())
|
||||||
used to link entries of this list together.
|
used to link entries of this list together.
|
||||||
|
|
||||||
|
Note: The link field in the appended entry is \b not modified, so if it is
|
||||||
|
actually the head of a list itself, the entire list will be appended.
|
||||||
*/
|
*/
|
||||||
#define AST_LIST_INSERT_TAIL(head, elm, field) do { \
|
#define AST_LIST_INSERT_TAIL(head, elm, field) do { \
|
||||||
typeof(elm) curelm = (head)->first; \
|
if (!(head)->first) { \
|
||||||
if (!curelm) { \
|
(head)->first = (elm); \
|
||||||
AST_LIST_INSERT_HEAD(head, elm, field); \
|
|
||||||
} else { \
|
} else { \
|
||||||
while (curelm->field.next!=NULL) { \
|
typeof(elm) curelm = (head)->first; \
|
||||||
|
while (curelm->field.next != NULL) \
|
||||||
curelm = curelm->field.next; \
|
curelm = curelm->field.next; \
|
||||||
} \
|
curelm->field.next = (elm); \
|
||||||
AST_LIST_INSERT_AFTER(curelm, elm, field); \
|
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
@@ -272,14 +274,13 @@ struct { \
|
|||||||
*/
|
*/
|
||||||
#define AST_LIST_REMOVE(head, elm, field) do { \
|
#define AST_LIST_REMOVE(head, elm, field) do { \
|
||||||
if ((head)->first == (elm)) { \
|
if ((head)->first == (elm)) { \
|
||||||
AST_LIST_REMOVE_HEAD((head), field); \
|
(head)->first = (elm)->field.next; \
|
||||||
} \
|
} \
|
||||||
else { \
|
else { \
|
||||||
typeof(elm) curelm = (head)->first; \
|
typeof(elm) curelm = (head)->first; \
|
||||||
while (curelm->field.next != (elm)) \
|
while (curelm->field.next != (elm)) \
|
||||||
curelm = curelm->field.next; \
|
curelm = curelm->field.next; \
|
||||||
curelm->field.next = \
|
curelm->field.next = (elm)->field.next; \
|
||||||
curelm->field.next->field.next; \
|
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user