diff --git a/sys/sys/queue.h b/sys/sys/queue.h index 0da19f7c9a8..be4c8b7e7b5 100644 --- a/sys/sys/queue.h +++ b/sys/sys/queue.h @@ -224,6 +224,10 @@ struct { \ (head)->stqh_last = &(head)->stqh_first; \ } while (0) +#define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do { \ + if (((head)->stqh_first = (elm)->field.stqe_next) == NULL) \ + (head)->stqh_last = &(head)->stqh_first; \ +} while (0) #define STAILQ_REMOVE(head, elm, type, field) do { \ if ((head)->stqh_first == (elm)) { \