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.
This commit is contained in:
Adam Sutton 2014-04-04 09:52:16 +01:00
parent 6482d33ba9
commit 143c33f15b

View file

@ -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)