diff --git a/include/villas/list.h b/include/villas/list.h index 3be253561..f6ba29dae 100644 --- a/include/villas/list.h +++ b/include/villas/list.h @@ -67,7 +67,7 @@ struct list { * * @param l A pointer to the list data structure. */ -void list_init(struct list *l); +int list_init(struct list *l); /** Destroy a list and call destructors for all list elements * diff --git a/lib/list.c b/lib/list.c index 1fa4e03e3..32cac84a4 100644 --- a/lib/list.c +++ b/lib/list.c @@ -47,7 +47,7 @@ static int cmp_sort(const void *a, const void *b, void *thunk) { return cmp(*(void **) a, *(void **) b); } -void list_init(struct list *l) +int list_init(struct list *l) { assert(l->state == STATE_DESTROYED); @@ -58,6 +58,8 @@ void list_init(struct list *l) l->array = NULL; l->state = STATE_INITIALIZED; + + return 0; } int list_destroy(struct list *l, dtor_cb_t destructor, bool release)