mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
o if any pattern rejects a device, and there were no accepts then reject !
This commit is contained in:
parent
f7cbb38dbb
commit
ac61645c2d
@ -237,7 +237,7 @@ static int _insert(const char *path, int rec)
|
||||
|
||||
} else { /* add a device */
|
||||
if (!S_ISBLK(info.st_mode)) {
|
||||
log_debug("%s: Not a block device", path);
|
||||
//log_debug("%s: Not a block device", path);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -150,7 +150,7 @@ static int _build_matcher(struct rfilter *rf, struct config_value *val)
|
||||
static int _accept_p(struct dev_filter *f, struct device *dev)
|
||||
{
|
||||
struct list *ah;
|
||||
int m, first = 1;
|
||||
int m, first = 1, rejected = 0;
|
||||
struct rfilter *rf = (struct rfilter *) f->private;
|
||||
struct str_list *sl;
|
||||
|
||||
@ -168,8 +168,9 @@ static int _accept_p(struct dev_filter *f, struct device *dev)
|
||||
|
||||
return 1;
|
||||
}
|
||||
} else
|
||||
return 1;
|
||||
|
||||
rejected = 1;
|
||||
}
|
||||
|
||||
first = 0;
|
||||
}
|
||||
@ -178,7 +179,7 @@ static int _accept_p(struct dev_filter *f, struct device *dev)
|
||||
* pass everything that doesn't match
|
||||
* anything.
|
||||
*/
|
||||
return 1;
|
||||
return !rejected;
|
||||
}
|
||||
|
||||
static void _destroy(struct dev_filter *f)
|
||||
|
@ -99,7 +99,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
while ((dev = dev_iter_get(iter)))
|
||||
printf("%s\n", dev->name);
|
||||
printf("%s\n", dev_name(dev));
|
||||
|
||||
dev_iter_destroy(iter);
|
||||
pfilter->destroy(pfilter);
|
||||
|
@ -70,7 +70,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
while ((dev = dev_iter_get(iter)))
|
||||
printf("%s\n", dev->name);
|
||||
printf("%s\n", dev_name(dev));
|
||||
|
||||
dev_iter_destroy(iter);
|
||||
filter->destroy(filter);
|
||||
|
Loading…
Reference in New Issue
Block a user