From: Tomas Valla Date: Wed, 5 Sep 2012 09:15:15 +0000 (+0200) Subject: slists: The behaviour of slist_remove_head now mimics clist_remove_head X-Git-Tag: v5.99~112 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=b2d3dc2b5c19c8b196c35793228ba28dbfff5eff;p=libucw.git slists: The behaviour of slist_remove_head now mimics clist_remove_head --- 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 */