summaryrefslogtreecommitdiff
path: root/udev_rules.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2006-01-27 01:40:26 +0100
committerKay Sievers <kay.sievers@suse.de>2006-01-27 01:40:26 +0100
commit2c02716281adaea9cf6f57caecaf51db8dbb0917 (patch)
tree5c5a549dae1fcc6f157a3363dcfc6785652a70f1 /udev_rules.c
parent36af2ddcb92c51acad0f909bb5dfb090cea9c5ed (diff)
remove redundant substitution of RUN key
Thanks to Andrey Borzenkov <arvidjaar@mail.ru> for the initial patch. Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Diffstat (limited to 'udev_rules.c')
-rw-r--r--udev_rules.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/udev_rules.c b/udev_rules.c
index 90dc0243fe..f1bbfd854c 100644
--- a/udev_rules.c
+++ b/udev_rules.c
@@ -994,6 +994,7 @@ int udev_rules_get_name(struct udev_rules *rules, struct udevice *udev)
/* set name, later rules with name set will be ignored */
if (rule->name.operation != KEY_OP_UNSET) {
int count;
+
name_set = 1;
strlcpy(udev->name, key_val(rule, &rule->name), sizeof(udev->name));
udev_rules_apply_format(udev, udev->name, sizeof(udev->name));
@@ -1008,17 +1009,14 @@ int udev_rules_get_name(struct udev_rules *rules, struct udevice *udev)
}
if (!udev->run_final && rule->run.operation != KEY_OP_UNSET) {
- char program[PATH_SIZE];
-
if (rule->run.operation == KEY_OP_ASSIGN_FINAL)
udev->run_final = 1;
if (rule->run.operation == KEY_OP_ASSIGN || rule->run.operation == KEY_OP_ASSIGN_FINAL) {
info("reset run list");
name_list_cleanup(&udev->run_list);
}
- strlcpy(program, key_val(rule, &rule->run), sizeof(program));
- dbg("add run '%s'", program);
- name_list_add(&udev->run_list, program, 0);
+ dbg("add run '%s'", key_val(rule, &rule->run));
+ name_list_add(&udev->run_list, key_val(rule, &rule->run), 0);
}
if (rule->last_rule) {
@@ -1075,16 +1073,12 @@ int udev_rules_get_run(struct udev_rules *rules, struct udevice *udev)
}
if (!udev->run_final && rule->run.operation != KEY_OP_UNSET) {
- char program[PATH_SIZE];
-
if (rule->run.operation == KEY_OP_ASSIGN || rule->run.operation == KEY_OP_ASSIGN_FINAL) {
info("reset run list");
name_list_cleanup(&udev->run_list);
}
- strlcpy(program, key_val(rule, &rule->run), sizeof(program));
- udev_rules_apply_format(udev, program, sizeof(program));
- dbg("add run '%s'", program);
- name_list_add(&udev->run_list, program, 0);
+ dbg("add run '%s'", key_val(rule, &rule->run));
+ name_list_add(&udev->run_list, key_val(rule, &rule->run), 0);
if (rule->run.operation == KEY_OP_ASSIGN_FINAL)
break;
}