summaryrefslogtreecommitdiff
path: root/udev_rules_parse.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2005-03-17 09:59:32 +0100
committerGreg KH <gregkh@suse.de>2005-04-26 23:53:53 -0700
commit67747e1de37158cd58782f432ccba8db55251592 (patch)
tree887efaf2b081dfe77d876c573e9cadfbbead41dc /udev_rules_parse.c
parent7e3e23925b139075746c015eaffaba509d5eb304 (diff)
[PATCH] change call_foreach_file to return a list
Diffstat (limited to 'udev_rules_parse.c')
-rw-r--r--udev_rules_parse.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/udev_rules_parse.c b/udev_rules_parse.c
index face496ab3..55412dba3c 100644
--- a/udev_rules_parse.c
+++ b/udev_rules_parse.c
@@ -168,7 +168,7 @@ static char *get_key_attribute(char *str)
return NULL;
}
-static int rules_parse(struct udevice *udev, const char *filename)
+static int rules_parse(const char *filename)
{
char line[LINE_SIZE];
char *bufline;
@@ -446,9 +446,18 @@ int udev_rules_init(void)
return -1;
if ((stats.st_mode & S_IFMT) != S_IFDIR)
- retval = rules_parse(NULL, udev_rules_filename);
- else
- retval = call_foreach_file(rules_parse, NULL, udev_rules_filename, RULEFILE_SUFFIX);
+ retval = rules_parse(udev_rules_filename);
+ else {
+ struct name_entry *name_loop, *name_tmp;
+ LIST_HEAD(name_list);
+
+ retval = add_matching_files(&name_list, udev_rules_filename, RULEFILE_SUFFIX);
+
+ list_for_each_entry_safe(name_loop, name_tmp, &name_list, node) {
+ rules_parse(name_loop->name);
+ list_del(&name_loop->node);
+ }
+ }
return retval;
}