summaryrefslogtreecommitdiff
path: root/policy.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-02-01 14:44:02 +1100
committerNeilBrown <neilb@suse.de>2011-02-01 14:44:02 +1100
commite5508b361d970a7657c9f81303223fa114bdcd9b (patch)
treebb4e33ec35abc0938bc8f9e2cb69ab5aee7c1cb7 /policy.c
parentd11128690b61e61c1ff12b2c4b3d7028a0715b1d (diff)
Allow domain_test to report that no domains were found.
Sometime we will need to know the difference between no domains found and domains didn't match. So allow domain_test to return different values and fix up all callers to maintain current behaviour. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'policy.c')
-rw-r--r--policy.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/policy.c b/policy.c
index 38b0072b..afb640f5 100644
--- a/policy.c
+++ b/policy.c
@@ -648,9 +648,12 @@ int domain_test(struct domainlist *dom, struct dev_policy *pol,
/* Check that all domains in pol (for metadata) are also in
* dom. Both lists are sorted.
* If pol has no domains, we don't really know about this device
- * so we reject the match.
+ * so we allow caller to choose:
+ * -1: has no domains
+ * 0: has domains, not all match
+ * 1: has domains, all match
*/
- int found_any = 0;
+ int found_any = -1;
struct dev_policy *p;
pol = pol_find(pol, pol_domain);