X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=namedev_parse.c;h=e360565950c71768975891c8264f76e21031e3b7;hp=02d8a6520c50fe3302cea0055e7a8f2bbfe62136;hb=30c6b4c9a22edc76b2e8335edbdf157dd51241eb;hpb=77313cd0d13ed3682f25c745f71f648292b28215 diff --git a/namedev_parse.c b/namedev_parse.c index 02d8a6520..e36056595 100644 --- a/namedev_parse.c +++ b/namedev_parse.c @@ -98,7 +98,7 @@ static char *get_key_attribute(char *str) return NULL; } -static int namedev_parse(const char *filename, void *data) +static int namedev_parse(struct udevice *udev, const char *filename) { char line[LINE_SIZE]; char *bufline; @@ -250,11 +250,11 @@ static int namedev_parse(const char *filename, void *data) attr = get_key_attribute(temp2 + sizeof(FIELD_NAME)-1); /* FIXME: remove old style options and make OPTIONS= mandatory */ if (attr != NULL) { - if (strstr(attr, ATTR_PARTITIONS) != NULL) { + if (strstr(attr, OPTION_PARTITIONS) != NULL) { dbg_parse("creation of partition nodes requested"); dev.partitions = DEFAULT_PARTITIONS_COUNT; } - if (strstr(attr, ATTR_IGNORE_REMOVE) != NULL) { + if (strstr(attr, OPTION_IGNORE_REMOVE) != NULL) { dbg_parse("remove event should be ignored"); dev.ignore_remove = 1; } @@ -292,15 +292,15 @@ static int namedev_parse(const char *filename, void *data) } if (strcasecmp(temp2, FIELD_OPTIONS) == 0) { - if (strstr(temp3, ATTR_IGNORE_DEVICE) != NULL) { + if (strstr(temp3, OPTION_IGNORE_DEVICE) != NULL) { dbg_parse("device should be ignored"); dev.ignore_device = 1; } - if (strstr(temp3, ATTR_IGNORE_REMOVE) != NULL) { + if (strstr(temp3, OPTION_IGNORE_REMOVE) != NULL) { dbg_parse("remove event should be ignored"); dev.ignore_remove = 1; } - if (strstr(temp3, ATTR_PARTITIONS) != NULL) { + if (strstr(temp3, OPTION_PARTITIONS) != NULL) { dbg_parse("creation of partition nodes requested"); dev.partitions = DEFAULT_PARTITIONS_COUNT; } @@ -354,9 +354,9 @@ int namedev_init(void) return -1; if ((stats.st_mode & S_IFMT) != S_IFDIR) - retval = namedev_parse(udev_rules_filename, NULL); + retval = namedev_parse(NULL, udev_rules_filename); else - retval = call_foreach_file(namedev_parse, udev_rules_filename, RULEFILE_SUFFIX, NULL); + retval = call_foreach_file(namedev_parse, NULL, udev_rules_filename, RULEFILE_SUFFIX); return retval; } @@ -364,8 +364,9 @@ int namedev_init(void) void namedev_close(void) { struct config_device *dev; + struct config_device *temp_dev; - list_for_each_entry(dev, &config_device_list, node) { + list_for_each_entry_safe(dev, temp_dev, &config_device_list, node) { list_del(&dev->node); free(dev); }