From 143c33f15bd0fe7421bc2929cdce081618ea66b9 Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Fri, 4 Apr 2014 09:52:16 +0100 Subject: [PATCH] queue: mod to TAILQ_MOVE to ensure empty Q is properly copied/init This mirrors a change that Andreas had already made in the showtime copy. --- src/queue.h | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/queue.h b/src/queue.h index bf5a4de0..889fdca5 100644 --- a/src/queue.h +++ b/src/queue.h @@ -132,9 +132,12 @@ #define TAILQ_MOVE(newhead, oldhead, field) do { \ if(TAILQ_FIRST(oldhead)) { \ TAILQ_FIRST(oldhead)->field.tqe_prev = &(newhead)->tqh_first; \ - } \ - (newhead)->tqh_first = (oldhead)->tqh_first; \ - (newhead)->tqh_last = (oldhead)->tqh_last; \ + (newhead)->tqh_first = (oldhead)->tqh_first; \ + (newhead)->tqh_last = (oldhead)->tqh_last; \ + TAILQ_INIT(oldhead);\ + } else { \ + TAILQ_INIT(newhead);\ + }\ } while (/*CONSTCOND*/0)