diff options
author | Kay Sievers <kay.sievers@suse.de> | 2005-08-27 16:15:41 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@suse.de> | 2005-08-27 16:15:41 +0200 |
commit | fb17920701dcba0d94e3fde566788a868e41d1ad (patch) | |
tree | 7667c49dd48312ec58ab12d4da92cb9206bb6b69 /udev_utils.c | |
parent | 314edf3ca44b268fa70a7a87a106322e2dd461af (diff) |
add and use name_list_cleanup() for cleaning up the string lists
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Diffstat (limited to 'udev_utils.c')
-rw-r--r-- | udev_utils.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/udev_utils.c b/udev_utils.c index de43dee30d..fc1e2e1f7e 100644 --- a/udev_utils.c +++ b/udev_utils.c @@ -224,6 +224,17 @@ int name_list_key_add(struct list_head *name_list, const char *key, const char * return 0; } +void name_list_cleanup(struct list_head *name_list) +{ + struct name_entry *name_loop; + struct name_entry *temp_loop; + + list_for_each_entry_safe(name_loop, temp_loop, name_list, node) { + list_del(&name_loop->node); + free(name_loop); + } +} + /* calls function for every file found in specified directory */ int add_matching_files(struct list_head *name_list, const char *dirname, const char *suffix) { |