diff options
author | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2008-12-15 00:32:47 (EST) |
---|---|---|
committer | ticktock35 <ticktock35@e8e0d7a0-c8d9-11dd-a880-a1081c7ac358> | 2008-12-15 00:32:47 (EST) |
commit | e91e75dcb824cdc22799b1eb15395d065b4d9518 (patch) | |
tree | 360954ba537c302a1420b347f1d571dc7c666fa1 /libopkg | |
parent | 014e4c306c4765c65abf1f2ce879bebcdd8c7261 (diff) |
opkg: implment active_list_clear()
git-svn-id: http://opkg.googlecode.com/svn/trunk@170 e8e0d7a0-c8d9-11dd-a880-a1081c7ac358
Diffstat (limited to 'libopkg')
-rw-r--r-- | libopkg/active_list.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libopkg/active_list.c b/libopkg/active_list.c index e297cfc..8544440 100644 --- a/libopkg/active_list.c +++ b/libopkg/active_list.c @@ -71,7 +71,22 @@ struct active_list * active_list_prev(struct active_list *head, struct active_li return prev; } +static void list_head_clear (struct list_head *head) { + struct active_list *next; + struct list_head *n, *ptr; + if (!head) + return; + list_for_each_safe(ptr, n , head) { + next = list_entry(ptr, struct active_list, node); + if (next->depend.next != &next->depend) { + list_head_clear(&next->depend); + } + list_del_init(&next->node); + next->depended = NULL; + } +} void active_list_clear(struct active_list *head) { + list_head_clear(&head->node); } void active_list_add_depend(struct active_list *node, struct active_list *depend) { |