summaryrefslogtreecommitdiff
path: root/udev_rules_parse.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2005-04-02 17:45:35 +0200
committerGreg KH <gregkh@suse.de>2005-04-26 23:55:00 -0700
commit821d0ec803a72841f173739f5b713fe847edab75 (patch)
tree4866ffc8b8c367cd6e62fd0616fffde01757e3e7 /udev_rules_parse.c
parente03a196a0d0680868ea230ab8f8d100ee90d0fa4 (diff)
[PATCH] add RUN key to be able to run rule based notification
SUBSYSTEM=="block", RUN="/sbin/program" will execute the program only for block device events. ACTION="remove", SUBSYSTEM=="block", RUN"/sbin/program" will execute the program, if a block device is removed.
Diffstat (limited to 'udev_rules_parse.c')
-rw-r--r--udev_rules_parse.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/udev_rules_parse.c b/udev_rules_parse.c
index 3c1631ab49..e665957b81 100644
--- a/udev_rules_parse.c
+++ b/udev_rules_parse.c
@@ -256,6 +256,13 @@ static int rules_parse(const char *filename)
continue;
}
+ if (strcasecmp(key, KEY_ACTION) == 0) {
+ strlcpy(rule.action, value, sizeof(rule.action));
+ rule.action_operation = operation;
+ valid = 1;
+ continue;
+ }
+
if (strcasecmp(key, KEY_BUS) == 0) {
strlcpy(rule.bus, value, sizeof(rule.bus));
rule.bus_operation = operation;
@@ -379,6 +386,12 @@ static int rules_parse(const char *filename)
continue;
}
+ if (strcasecmp(key, KEY_RUN) == 0) {
+ strlcpy(rule.run, value, sizeof(rule.run));
+ valid = 1;
+ continue;
+ }
+
if (strcasecmp(key, KEY_OPTIONS) == 0) {
if (strstr(value, OPTION_LAST_RULE) != NULL) {
dbg("last rule to be applied");