diff options
author | NeilBrown <neilb@suse.de> | 2011-02-01 14:44:02 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-02-01 14:44:02 +1100 |
commit | e5508b361d970a7657c9f81303223fa114bdcd9b (patch) | |
tree | bb4e33ec35abc0938bc8f9e2cb69ab5aee7c1cb7 /policy.c | |
parent | d11128690b61e61c1ff12b2c4b3d7028a0715b1d (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.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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); |