]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: fix warning in linklist api 4173/head
authorMark Stapp <mjs@voltanet.io>
Mon, 22 Apr 2019 19:49:16 +0000 (15:49 -0400)
committerMark Stapp <mjs@voltanet.io>
Mon, 22 Apr 2019 19:49:16 +0000 (15:49 -0400)
Add return value and comment to new/recent linklist api
to clean up compile warning.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
lib/linklist.c
lib/linklist.h

index d3ecc00306b555549a93f934a2365b1500b65cd2..40c4b271698ce48d125f8e14abfeee20ebd8519c 100644 (file)
@@ -328,7 +328,7 @@ void list_sort(struct list *list, int (*cmp)(const void **, const void **))
        XFREE(MTYPE_TMP, items);
 }
 
-void listnode_add_force(struct list **list, void *val)
+struct listnode *listnode_add_force(struct list **list, void *val)
 {
        if (*list == NULL)
                *list = list_new();
index dd90608bcb5d87852a8daecb7719c93b6e2a287e..c30d8d314a3bb785d016bb1d3e529ca2f77aac68 100644 (file)
@@ -343,7 +343,13 @@ extern void list_add_list(struct list *list, struct list *add);
 
 extern struct listnode *listnode_lookup_nocheck(struct list *list, void *data);
 
-extern void listnode_add_force(struct list **list, void *val);
+/*
+ * Add a node to *list, if non-NULL. Otherwise, allocate a new list, mail
+ * it back in *list, and add a new node.
+ *
+ * Return: the new node.
+ */
+extern struct listnode *listnode_add_force(struct list **list, void *val);
 
 #ifdef __cplusplus
 }