summaryrefslogtreecommitdiff
path: root/udev_rules_parse.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@suse.de>2005-07-12 14:46:36 +0200
committerKay Sievers <kay.sievers@suse.de>2005-07-12 14:46:36 +0200
commit0bfb84e1edd96b1e82ffd74c43b865e5d6dbf204 (patch)
treecf8e46f8314b80aebb7a0e4426e77d2fab9835a3 /udev_rules_parse.c
parent0cd4ac473a51577e33e700beccb3479e5565d661 (diff)
IMPORT: add {parent} to import the persistent data of the parent device
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
Diffstat (limited to 'udev_rules_parse.c')
-rw-r--r--udev_rules_parse.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/udev_rules_parse.c b/udev_rules_parse.c
index 9483bcd71f..7c3c2e7fc2 100644
--- a/udev_rules_parse.c
+++ b/udev_rules_parse.c
@@ -311,9 +311,13 @@ static int add_to_rules(struct udev_rules *rules, char *line)
attr = get_key_attribute(key + sizeof("IMPORT")-1);
if (attr && strstr(attr, "program")) {
dbg("IMPORT will be executed");
- rule->import_exec = 1;
+ rule->import_type = IMPORT_PROGRAM;
} else if (attr && strstr(attr, "file")) {
dbg("IMPORT will be included as file");
+ rule->import_type = IMPORT_FILE;
+ } else if (attr && strstr(attr, "parent")) {
+ dbg("IMPORT will include the parent values");
+ rule->import_type = IMPORT_PARENT;
} else {
/* figure it out if it is executable */
char file[PATH_SIZE];
@@ -326,8 +330,11 @@ static int add_to_rules(struct udev_rules *rules, char *line)
pos[0] = '\0';
dbg("IMPORT auto mode for '%s'", file);
if (!lstat(file, &stats) && (stats.st_mode & S_IXUSR)) {
- dbg("IMPORT is executable, will be executed");
- rule->import_exec = 1;
+ dbg("IMPORT is executable, will be executed (autotype)");
+ rule->import_type = IMPORT_PROGRAM;
+ } else {
+ dbg("IMPORT is not executable, will be included as file (autotype)");
+ rule->import_type = IMPORT_FILE;
}
}
add_rule_key(rule, &rule->import, operation, value);