From b2d3dc2b5c19c8b196c35793228ba28dbfff5eff Mon Sep 17 00:00:00 2001 From: Tomas Valla Date: Wed, 5 Sep 2012 11:15:15 +0200 Subject: [PATCH] slists: The behaviour of slist_remove_head now mimics clist_remove_head --- ucw/slists.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ucw/slists.h b/ucw/slists.h index 5c6d29f9..30089ac7 100644 --- a/ucw/slists.h +++ b/ucw/slists.h @@ -116,9 +116,12 @@ static inline void slist_remove_after(slist *l, snode *after) /** * Remove the first node in @l. The list can be empty. **/ -static inline void slist_remove_head(slist *l) +static inline void *slist_remove_head(slist *l) { - slist_remove_after(l, &l->head); + snode *n = slist_head(l); + if (n) + slist_remove_after(l, &l->head); + return n; } /* Loops */ -- 2.39.5