s3-locking: update to use DLIST_ADD_AFTER()
authorAndrew Tridgell <tridge@samba.org>
Sat, 6 Feb 2010 01:41:07 +0000 (12:41 +1100)
committerJeremy Allison <jra@samba.org>
Wed, 10 Feb 2010 23:40:44 +0000 (15:40 -0800)
(cherry picked from commit 6c6df527e14514027cbcaa6deac25adf04363926)

source3/locking/posix.c

index 17945399c59ceff51b700c9f381453c48a92d51a..e6acbe8bac4f2f38e397067043c0452150a585f5 100644 (file)
@@ -908,12 +908,8 @@ new: start=%.0f,size=%.0f\n", (double)l_curr->start, (double)l_curr->size,
 
                                /*
                                 * Add into the dlink list after the l_curr point - NOT at lhead. 
-                                * Note we can't use DLINK_ADD here as this inserts at the head of the given list.
                                 */
-
-                               l_new->prev = l_curr;
-                               l_new->next = l_curr->next;
-                               l_curr->next = l_new;
+                               DLIST_ADD_AFTER(lhead, l_new, l_curr);
 
                                /* And move after the link we added. */
                                l_curr = l_new->next;