[svn-commits] kpfleming: branch 1.4 r87069 - in /branches/1.4: include/asterisk/ main/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Oct 25 18:03:12 CDT 2007


Author: kpfleming
Date: Thu Oct 25 18:03:11 2007
New Revision: 87069

URL: http://svn.digium.com/view/asterisk?view=rev&rev=87069
Log:
appending one list to another should leave the first list empty, and not require the user to do that

Modified:
    branches/1.4/include/asterisk/linkedlists.h
    branches/1.4/main/channel.c

Modified: branches/1.4/include/asterisk/linkedlists.h
URL: http://svn.digium.com/view/asterisk/branches/1.4/include/asterisk/linkedlists.h?view=diff&rev=87069&r1=87068&r2=87069
==============================================================================
--- branches/1.4/include/asterisk/linkedlists.h (original)
+++ branches/1.4/include/asterisk/linkedlists.h Thu Oct 25 18:03:11 2007
@@ -686,6 +686,9 @@
   \param list This is a pointer to the list to be appended.
   \param field This is the name of the field (declared using AST_LIST_ENTRY())
   used to link entries of this list together.
+
+  Note: The source list (the \a list parameter) will be empty after
+  calling this macro (the list entries are \b moved to the target list).
  */
 #define AST_LIST_APPEND_LIST(head, list, field) do {			\
       if (!(head)->first) {						\
@@ -695,6 +698,8 @@
 		(head)->last->field.next = (list)->first;		\
 		(head)->last = (list)->last;				\
       }									\
+      (list)->first = NULL;						\
+      (list)->last = NULL;						\
 } while (0)
 
 #define AST_RWLIST_APPEND_LIST AST_LIST_APPEND_LIST

Modified: branches/1.4/main/channel.c
URL: http://svn.digium.com/view/asterisk/branches/1.4/main/channel.c?view=diff&rev=87069&r1=87068&r2=87069
==============================================================================
--- branches/1.4/main/channel.c (original)
+++ branches/1.4/main/channel.c Thu Oct 25 18:03:11 2007
@@ -3579,7 +3579,6 @@
 	/* XXX Is this always correct?  We have to in order to keep MACROS working XXX */
 	if (AST_LIST_FIRST(&clone->varshead))
 		AST_LIST_APPEND_LIST(&original->varshead, &clone->varshead, entries);
-	AST_LIST_HEAD_INIT_NOLOCK(&clone->varshead);
 
 	/* then, dup the varshead list into the clone */
 	




More information about the svn-commits mailing list