chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
add udev_rules_run() to handle RUN list
[elogind.git]
/
udev_rules_parse.c
diff --git
a/udev_rules_parse.c
b/udev_rules_parse.c
index 9a12d53816e59f4dfaa50d3add57e4c243f5c925..638ea159fbdf71e15f9a65b9cd6efb84a894a39b 100644
(file)
--- a/
udev_rules_parse.c
+++ b/
udev_rules_parse.c
@@
-425,13
+425,13
@@
static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
if (strncasecmp(key, "IMPORT", sizeof("IMPORT")-1) == 0) {
attr = get_key_attribute(key + sizeof("IMPORT")-1);
if (strncasecmp(key, "IMPORT", sizeof("IMPORT")-1) == 0) {
attr = get_key_attribute(key + sizeof("IMPORT")-1);
- if (attr && strstr(attr, "program")) {
+ if (attr
!= NULL
&& strstr(attr, "program")) {
dbg("IMPORT will be executed");
rule->import_type = IMPORT_PROGRAM;
dbg("IMPORT will be executed");
rule->import_type = IMPORT_PROGRAM;
- } else if (attr && strstr(attr, "file")) {
+ } else if (attr
!= NULL
&& strstr(attr, "file")) {
dbg("IMPORT will be included as file");
rule->import_type = IMPORT_FILE;
dbg("IMPORT will be included as file");
rule->import_type = IMPORT_FILE;
- } else if (attr && strstr(attr, "parent")) {
+ } else if (attr
!= NULL
&& strstr(attr, "parent")) {
dbg("IMPORT will include the parent values");
rule->import_type = IMPORT_PARENT;
} else {
dbg("IMPORT will include the parent values");
rule->import_type = IMPORT_PARENT;
} else {
@@
-477,7
+477,12
@@
static int add_to_rules(struct udev_rules *rules, char *line, const char *filena
continue;
}
continue;
}
- if (strcasecmp(key, "RUN") == 0) {
+ if (strncasecmp(key, "RUN", sizeof("RUN")-1) == 0) {
+ attr = get_key_attribute(key + sizeof("RUN")-1);
+ if (attr != NULL) {
+ if (strstr(attr, "ignore_error"))
+ rule->run_ignore_error = 1;
+ }
add_rule_key(rule, &rule->run, operation, value);
valid = 1;
continue;
add_rule_key(rule, &rule->run, operation, value);
valid = 1;
continue;