Merge branch 'collectd-4.1' into collectd-4.2
[collectd.git] / src / utils_llist.c
index a815035..d5db9dc 100644 (file)
@@ -21,6 +21,8 @@
  *   Florian Forster <octo at verplant.org>
  */
 
+#include "config.h"
+
 #include <stdlib.h>
 #include <string.h>
 
@@ -108,6 +110,9 @@ void llist_prepend (llist_t *l, llentry_t *e)
 {
        e->next = l->head;
        l->head = e;
+
+       if (l->tail == NULL)
+               l->tail = e;
 }
 
 void llist_remove (llist_t *l, llentry_t *e)