From: kay.sievers@vrfy.org Date: Sat, 12 Mar 2005 21:55:08 +0000 (+0100) Subject: [PATCH] add OPTION="last_rule" to skip any later rule X-Git-Tag: 055~15 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=3b6ed8bb06d18a2855d530dcb9034e9d37114827;hp=e5e322bc627a07d29a07e08f7c96bd644a3ae057 [PATCH] add OPTION="last_rule" to skip any later rule --- diff --git a/test/udev-test.pl b/test/udev-test.pl index c7e1a9d47..52c5c8d48 100644 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -1115,9 +1115,18 @@ EOF subsys => "block", devpath => "/block/sda/sda1", exp_name => "start-udev-root-end", - option => "clean", conf => < "last_rule option", + subsys => "block", + devpath => "/block/sda/sda1", + exp_name => "last", + conf => <last_rule) { + dbg("last rule to be applied"); + break; + } + } } diff --git a/udev_rules.h b/udev_rules.h index 71c510bce..42552cfa4 100644 --- a/udev_rules.h +++ b/udev_rules.h @@ -43,6 +43,7 @@ #define FIELD_MODE "MODE" #define FIELD_OPTIONS "OPTIONS" +#define OPTION_LAST_RULE "last_rule" #define OPTION_IGNORE_DEVICE "ignore_device" #define OPTION_IGNORE_REMOVE "ignore_remove" #define OPTION_PARTITIONS "all_partitions" @@ -74,9 +75,10 @@ struct udev_rule { char group[USER_SIZE]; mode_t mode; - int partitions; + int last_rule; int ignore_device; int ignore_remove; + int partitions; char config_file[PATH_SIZE]; int config_line; diff --git a/udev_rules_parse.c b/udev_rules_parse.c index 4f431decf..f77f3db91 100644 --- a/udev_rules_parse.c +++ b/udev_rules_parse.c @@ -283,6 +283,10 @@ static int rules_parse(struct udevice *udev, const char *filename) } if (strcasecmp(temp2, FIELD_OPTIONS) == 0) { + if (strstr(temp3, OPTION_LAST_RULE) != NULL) { + dbg("last rule to be applied"); + rule.last_rule = 1; + } if (strstr(temp3, OPTION_IGNORE_DEVICE) != NULL) { dbg("device should be ignored"); rule.ignore_device = 1;