From: Adam Sutton Date: Fri, 4 Apr 2014 08:52:16 +0000 (+0100) Subject: queue: mod to TAILQ_MOVE to ensure empty Q is properly copied/init X-Git-Tag: v4.1~2208 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=143c33f15bd0fe7421bc2929cdce081618ea66b9;p=thirdparty%2Ftvheadend.git 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. --- diff --git a/src/queue.h b/src/queue.h index bf5a4de06..889fdca5b 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)